discourse/app/assets/javascripts/float-kit/addon/modifiers
Joffrey JAFFEUX 0e37ceeeb9
FIX: improves reliability of post-text-selection bar (#24093)
The main change made is to use `pointerdown` and `touchstart` for detecting click outside in `FloatKit`, the problem of using `click` is that it will trigger on `mouseup` which is not working well with `FloatKit` shown using `mousedown` (when we change selection with the `mousedown` for example) as the release will be interpreted as a click outside and close the menu. To solve this issue the previous code in `post-text-selection` was going through various hacks for detecting state of mouse which are not always very reliable.

The second fix is to exit earlier when selection didn't change.

This has been tested on chrome/firefox and safari (mobile) and seems to work reliably.

<!-- NOTE: All pull requests should have tests (rspec in Ruby, qunit in JavaScript). If your code does not include test coverage, please include an explanation of why it was omitted. -->
2023-10-25 14:34:53 +02:00
..
apply-floating-ui.js DEV: Sort imports 2023-10-10 21:46:54 +01:00
close-on-click-outside.js FIX: improves reliability of post-text-selection bar (#24093) 2023-10-25 14:34:53 +02:00
close-on-escape.js DEV: Sort imports 2023-10-10 21:46:54 +01:00