It seems like when a gesture begins in textarea or input, touch-action is ignored. This is unexpected for me. Expected behavior: touch-action is taken into account and e.g. scrolling does not happen (see demo below).
Demo: https://jsfiddle.net/1x8pc5ed/1/ (Open the desktop browser developer tools and activate the touch simulation or just open it on your phone, then try to scroll the page starting the gesture from the textarea, input and other areas for comparison.)
I've tested it in Firefox and Chrome:
- Chrome ignores
touch-actiononly intextareacase. - Firefox ignores
touch-actionininputandtextareacases.
Can anyone explain this behavior? For me it looks like a bug.
About
textareacase:This is probably not a bug, but expected behavior.
According to https://w3c.github.io/pointerevents/#determining-supported-touch-behavior:
I.e. in this case the chain begins and ends on
textareabecause thetextareapotentially has default touch behavior (potentially it can be scrollable).Applying
overflow: hiddenortouch-action: noneontextarealet to prevent scrolling.