iOS iPad Fixed position breaks when keyboard is opened

前端 未结 7 1902
春和景丽
春和景丽 2020-12-07 11:21

Fixed position breaks on header when I click on the \"Search Form\" text box field. It simply detaches from the top of the page (as it\'s fixed up there) and starts floating

7条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-07 11:39

    In our case this would fix itself as soon as user scrolls. So this is the fix we've been using to simulate a scroll:

    $(document).on('blur', 'input, textarea', function () {
        setTimeout(function () {
            window.scrollTo(document.body.scrollLeft, document.body.scrollTop);
        }, 0);
    });
    

提交回复
热议问题