chosen icon indicating copy to clipboard operation
chosen copied to clipboard

Ignore context (right click) mousedown events

Open alademann opened this issue 12 years ago • 5 comments

Otherwise, the native browser context menu appears on right click of container, and on right click of search result item, AND the default chosen "click" action occurs at the same time, producing an unexpected result for the end-user.

Fixes #949

alademann avatar Sep 29 '13 17:09 alademann

@alademann any chance you update your PR with the requested changes ?

stof avatar Oct 11 '13 22:10 stof

@stof I made some updates based on your feedback. Added a method that does cross-browser compatible checking of mousedown events so that the boolean logic can check for "is left click" instead of "is not right click".

Please review when you have a chance. Thanks!

alademann avatar Oct 12 '13 15:10 alademann

@stof - moved the mousedown_checker method as requested.

alademann avatar Oct 12 '13 16:10 alademann

Wouldn't a function is_left_click suffice? As the others are never considered.

koenpunt avatar Oct 13 '13 20:10 koenpunt

@koenpunt the naming convention of the function I added follows the keydown_checker method - since what we're doing in this case is checking which mousedown event is being fired. Even though the other cases are not considered - I think the way it's currently implemented is more scalable for any additional interactions that may need to check for the type of mousedown event.

I'm happy to change it so that it returns a simple boolean - just throwing it out that its possible the function could be used for other use-cases.

alademann avatar Oct 14 '13 14:10 alademann