You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the latest version of Firefox , the document click event is triggering when a mousedown event occurs on a select element while using Select2. This behavior is different from other browsers.
#6278
Open
keerthivasan12 opened this issue
Oct 13, 2023
· 2 comments
In the latest version of Firefox, I'm encountering an unexpected behavior related to mousedown and click events when interacting with a select element within the Select2 library. The issue is not present in other web browsers.
Details:
Expected Behavior: Click events should not propagate to the document when interacting with a select element.
Observed Behavior in Firefox: Click events on the select element trigger the document click event.
Steps to Reproduce:
Use the provided HTML and JavaScript code.
Open the webpage in Firefox (Latest version).
Interact with the select element within the Select2 dropdown.
Even I am facing the similar issue on FireFox version 118 or above. The click event on select2 field is getting propagated, reason being we are now required to handle this unexpected behaviour explicitly on different parent node. For example to handle click at document level I am forced to add additional check :
$document.on('click', clickHandler);
function clickHandler(e){
if($(e.currentTarget.activeElement).hasClass('select2-active')){
return;
}
//other required operation on click
}
This seems to be serious issue as for other browsers behaviour is not same
Description:
In the latest version of Firefox, I'm encountering an unexpected behavior related to mousedown and click events when interacting with a select element within the Select2 library. The issue is not present in other web browsers.
Details:
Expected Behavior: Click events should not propagate to the document when interacting with a select element.
Observed Behavior in Firefox: Click events on the select element trigger the document click event.
Steps to Reproduce:
Use the provided HTML and JavaScript code.
Open the webpage in Firefox (Latest version).
Interact with the select element within the Select2 dropdown.
`
The text was updated successfully, but these errors were encountered: