pmusaraj
(Penar Musaraj)
21 Aprile 2023, 6:34pm
15
Grazie, questo dovrebbe essere risolto tramite:
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.
C’è una spiegazione abbastanza lunga nella descrizione della PR, in breve in precedenza saltavamo l’evento clickOutside per il menu di ricerca quando c’era del testo selezionato. Ma selezioniamo automaticamente il testo dell’input del menu di ricerca, quindi questo passa a una tecnica diversa.
4 Mi Piace