Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-word selection not possible on phone #142

Open
HugoFara opened this issue Aug 19, 2023 · 2 comments
Open

Multi-word selection not possible on phone #142

HugoFara opened this issue Aug 19, 2023 · 2 comments
Labels
bug Something isn't working ux User Experience could be better

Comments

@HugoFara
Copy link
Owner

HugoFara commented Aug 19, 2023

This bug seems to affect all LWT version including 2.8.0, signaled on Discord.

After a quick search, the behavior of mword_drag_n_drop_select in jq_pgm.js may be wrong.

@HugoFara HugoFara added bug Something isn't working ux User Experience could be better labels Aug 19, 2023
@HugoFara
Copy link
Owner Author

Based on https://stackoverflow.com/questions/51333798/how-can-i-make-mousedown-mouseup-trigger-on-mobile-devices and experiments with a nice user, we can trigger the event through:

$('#thetext')
.on('selectstart','span',false)
.on(
        'mousedown', '.wsty',
        {annotation: ANNOTATIONS_MODE}, 
        mword_drag_n_drop_select
).on(
        'touchstart', '.wsty',
        {annotation: ANNOTATIONS_MODE}, 
        mword_drag_n_drop_select
);

(in prepareTextInteractions).

More info incoming!

@HugoFara
Copy link
Owner Author

HugoFara commented Jan 4, 2024

Hi again!

I have spent my day breaking my teeth on this issue as I wanted to "fix" before the next release. Unfortunately, that won't be so easy.

The main issue is that "click" event and "touch" events are not independent, but they do not constitute a subset of one another. Most devices trigger "mousedown" when "touchstart" is triggered, while some other interactions do not have an equivalent ("mouseenter" does not have a "touch" equivalent).

That being said, I started to develop a new system for multi-word that would be touch friendly on mobile-multi-word. The issue is that I cannot find a way to prevent the current interaction system to interfere. I think that the best solution is to redo the multi-word selection system from scratch.

As it is an important UX change, I hope to bundle it in LWT 3.0.0! See you later on!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ux User Experience could be better
Projects
Status: Todo
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant