pmusaraj
(Penar Musaraj)
Avril 21, 2023, 6:34
15
Merci, cela devrait être corrigé via :
main ← search-selection-tweak
opened 05:37PM - 21 Apr 23 UTC
Followup to 17ba00c3950eb0a78dd510f3618f8e7be2d448fc. Fix for https://meta.disco… urse.org/t/-/261917
This fixes a usability issue where the user couldn't switch to the user menu when the search menu was visible and the text in the input was selected.
Explanation: The `click` event is triggered both when clicking and when selecting text. This means that when selecting text in the search input, at the end of the selection event, a click event is triggered. And if that click event happens outside of the search menu (i.e. when you continue dragging outside the input), then the menu would be dismissed.
Previously, we fixed this by checked for the presence of a current text selection. But that results in a small side-effect reported in the linked issue on meta. This PR sets a flag during `mouseDown` when starting a text selection in the input and then it uses that flag when evaluating whether to trigger `clickOutside` or not.
Il y a une explication assez longue dans la description de la PR, en bref, nous ignorions précédemment l’événement clickOutside pour le menu de recherche lorsqu’il y avait du texte sélectionné. Mais nous sélectionnons automatiquement le texte de l’entrée du menu de recherche, donc cela passe à une technique différente.
4 « J'aime »