touchmove

JavaScript DOM changes in touchmove delayed until scroll ends on mobile Safari

℡╲_俬逩灬. 提交于 2019-11-27 00:23:51
问题 In mobile safari, in the course of handling touchmove for an element, I change the className of that element. Unfortunately, the visual change does not occur while the user is scrolling, or until the very end of an inertial scroll. What can I do to get the className to visually take immediately? More: Apparently this isn't limited to className changes, but seemingly any change to the DOM, such as innerHTML and style . 回答1: This is by design unfortunately. iOS safari will queue up all DOM

Can't prevent `touchmove` from scrolling window on iOS

家住魔仙堡 提交于 2019-11-26 22:47:59
问题 We are trying to scroll an element on our iOS web app while preventing the window itself from scrolling. We are capturing the touchmove event on the window, scrolling the element programmatically and (trying to) prevent the window itself from scroll by calling preventDefault on the event. Unfortunately this doesn't work in Mobile Safari. The window continues to scroll underneath our element. The issue sounds exactly like the Webkit bug described in https://bugs.webkit.org/show_bug.cgi?id