jquery-archive / jquery-mobile

jQuery Mobile Framework
https://jquerymobile.com
Other
9.7k stars 2.41k forks source link

Swiping unexpectedly prevents text selection #8670

Open saschanaz opened 2 years ago

saschanaz commented 2 years ago

jQuery Mobile calls preventDefault() on touch events to prevent scrolling.

https://github.com/jquery/jquery-mobile/blob/4a6395df87acc4065ba39c3ab17d419fdc1a585b/js/events/touch.js#L248-L251

But this line accidentally also calls preventDefault() when event is not a TouchEvent but a MouseEvent, and thus unexpectedly prevent desktop browsers from selecting texts, which is causing web compatibility issue.

The line should check the event type to prevent such issue.