Skip to content
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

"Double Click" functionality is broken in Chrome 125. #236

Open
JamoCA opened this issue May 20, 2024 · 3 comments
Open

"Double Click" functionality is broken in Chrome 125. #236

JamoCA opened this issue May 20, 2024 · 3 comments

Comments

@JamoCA
Copy link

JamoCA commented May 20, 2024

I used to be able to double-click an item, and it would switch to the other side, but this no longer appear to work in Chrome 125 (latest) or 126 (Dev/Beta). I used BrowserStack to test and confirm. Testing on my local workstation using Microsoft Edge & Brave browsers indicates that this problem is likely connected to Chromium.

To test this, go to the "zero configuration" test and double-click any of the options on the left-side:
https://crlcu.github.io/multiselect/examples/zero-configuration.html

When using Chromium, options need to be selected first and then double-clicked in order to switch sides.

I tested Firefox. It appears to be working correctly. (Double-clicking without selecting correctly transfers the option to the other side.)

I haven't been able to find anything regarding this issue (or a workaround) yet.

@JamoCA
Copy link
Author

JamoCA commented May 20, 2024

I may have found a fix... I changed these lines:

var $options = self.$left.find('option:selected:not(.hidden)');
var $options = self.$right.find('option:selected:not(.hidden)');

to this:

var $options = $(this);

... and double-click is working again in Chromium 125+. (I considered that if you were able to double-click an option, chances are it's "not hidden" and you want it to be selected.)

Is this the best fix for this? I tested it with latest Firefox, Microsoft Edge, Chrome 126 (dev) and it appears to function correctly for a single option. (I see that Firefox can move multiple selected options with a double-click without this "fix".)

@mihaiandreicut
Copy link

mihaiandreicut commented May 24, 2024

@JamoCA : If you need a fix:

$node.on('click', function(e) {
    if (e.originalEvent.detail > 1) {
        // If you are returning a value from this function, use 'return false' or cancel the event in some other way.
        return;
   }
    // Your click event logic here.
});

@JamoCA
Copy link
Author

JamoCA commented May 28, 2024

@mihaiandreicut The fix you proposed doesn't appear to have any effect and doesn't work. I would expect that the double-clicked item would move to the other side, but regardless of which option is double-clicked and regardless of whether the option is pre-selected or not, nothing happens. (e.originalEvent.detail appears to always be 2.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants