Fix dropdown closing when mouseup is outside
What does this MR do?
Fixes an annoying behavior where dropdowns are closed when mousedown
is inside the dropdown but mouseup
is outside.
This happens very frequently for me when copying / editing a long branch name in the "Create merge request" dropdown:
Screen_Recording_2019-08-22_at_1.55.36_PM
This MR changes the event listened to mousedown
instead of click
so that this doesn't happen.
A side-effect: Right-clicking outside the dropdown now closes the dropdown. We could add some code in the event handler to prevent this but I think it's okay to close it if we right click outside.
This was discussed in https://gitlab.slack.com/archives/CETG54GQ0/p1566425318367100
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry for user-facing changes, or community contribution. Check the link for other scenarios. -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Performance and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team