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
QTabs swipeable makes text very hard to select #15503
Comments
Hi, The solution offered is not ok because this would hinder the functionality if any text is selected, even outside of the panel. There is no easy way out of this, except for disabling the swipe functionality. |
The way to get around this would be to compare the selected text at the start of the swipe and before triggering it, if it's the same, proceed with the swipe, if it's different, abort the swipe The swipe is extremely usefull on devices with touch enabled (and nowadays it's not just mobiles, a lot of laptops come with both touch and trackpad making feature detection buggy) so disabling it is not really an option. Selection is not a highly needed feature by itself and can be treated low priority, but there definitely is some solutions possible |
Wish it were that easy. Reopening for assessing an idea. |
Something I noticed is this quasar/ui/src/composables/private/use-panel.js Lines 63 to 75 in 6948057
Notice the Maybe we can give the option to disable mouse swipe for panel, which would also solve this issue |
Think I found a way to do it properly. |
The gist of the fix: after swipe detection starts and mouse moves, also check if any text is currently selected (previous selection, if any, was automatically discarded when swipe has started); ALSO, we were avoiding triggering swipe for INPUT elements, but we should also do this for TEXTAREA -- and this is even more important now (besides the main obvious reason), especially for Firefox (where additional work would anyway be needed besides the getSelection() API -- see firefox bug) Fix will be available in Quasar 2.11.11 |
Also, thanks for insisting with this ticket! We made Quasar better. |
Well, thank you for fixing this issue. All credits to you 😉 |
What happened?
When using swipeable QTabsPanel, if you try to select some text in a normal motion (not slow) instead of selecting text, it will change tab
What did you expect to happen?
The tab not to change If the user is selecting text with it's mouse
Reproduction URL
https://codepen.io/Tofandel/pen/vYzgmKN?editors=101
How to reproduce?
Flavour
Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)
Areas
Composables (quasar/usePanel)
Directives (quasar/TouchSwipe)
Additional context
If you go really slow you can select the text, but it's not user friendly
If I remove swipeable then it's not mobile friendly
Proposed solution
Check the current selected text before swiping and if it's not empty, abort the swipe
The text was updated successfully, but these errors were encountered: