[ad_1]
I want to add enter and textarea parts to a jQuery UI sortable. Here is a easy instance of what I am making an attempt:
<div id="sortable">
<div>
alpha
<enter kind="textual content"/>
</div>
<div>
beta
<textarea></textarea>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
<script src="https://code.jquery.com/ui/1.13.1/jquery-ui.js"></script>
<script>
$('#sortable').sortable();
</script>
On desktop, I’ve no drawback interacting with each fields. However on my Android gadget, clicking on both discipline seemingly does nothing. I’ve been informed that the weather additionally don’t work on iOS.
I’ve tried just a few potential workarounds, however to little avail. First I’ve tried attaching to the press occasion, on both the draggable ingredient or the enter fields themselves:
$('enter, textarea').click on(operate(){
$(this).focus();
});
Surprisingly, this appeared to work perhaps 10% of the time? The inconsistent habits made me assume that I had a race situation with some side of jQuery UI, so I experimented with delaying my code:
var interval = setInterval(operate(){
$(this).focus();
clearInterval(interval);
}, 1000);
Even with such an extended wait, my clicks are nonetheless steadily ignored. I’ve additionally tried attaching to certainly one of jQuery UI’s sortable occasions, however requiring a consumer to tug a component with the intention to get concentrate on the sphere is just not splendid. May somebody with extra cell growth abilities enlighten me about why this is not working? Every other workarounds that could possibly be used to get this working?
[ad_2]
