1

I don't particularly want to use Jquery Mobile, because I only use it for swipeleft and swiperight....but it is the only touch event library I could find that works with classes and on for dynamically added content. I did use the downloader to grab what I only needed at the time (can't remember what), but that was a while ago and the downloader is broken now, so I recently found a comment on here with just the touch events. And it is still causing this issue. https://stackoverflow.com/a/51800929/11773633

The problem I am having is that if I declare swipeleft and swiperight anywhere at least once, whether it affects content that is on the page or not...it causes inputs and textareas to not only be unable to drag select text from anywhere inside the field, but also to not allow drag on the text itself... it only selects 3 characters.

This is a jsfiddle with an example. I am linking that copy of of Jquery Mobile v1.4.5 with just touch events in the html section. I use Jquery 2.2.4 also, so that is set.

http://jsfiddle.net/fLxb3dcr/

$(document).on('touchstart touchmove touchend tap taphold swipe swipeleft swiperight scrollstart scrollstop','textarea', function(event) {
        return false;
    });

I just want to find a fix for this drag select text issue for input fields... And it seems I can't prevent whatever this script does that seems to change the way drag in input fields works. As long as swipe is used, it causes this issue.

1 Answers1

1

I am not sure how this might affect things exactly... but the culprit after extensive digging... turns out to be scrollSupressionThreshold. It is set to 30, which for some reason affects all elements whether they are being targeted or not. I am not sure what this threshold is meant to do in the grand scheme of things, but by setting it to a really high number, in this case exponential notation 1e9, it completely removes all issues for input fields. I am sure this might come back to bite me, but swiping still works and that is all I wanted really.

e.event.special.swipe = {
            scrollSupressionThreshold: **(change from 30 to 1e9)**,
            durationThreshold: 1e3,
            horizontalDistanceThreshold: 30,
            verticalDistanceThreshold: 30,