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

CAMS-516 UseOutsideClick now acts on mousedown, not click #1176

Merged
merged 2 commits into from
Jan 31, 2025

Conversation

fmaddenflx
Copy link
Contributor

Purpose

Bug Fix for -- comboBox outside click action was swallowing up the click event, such that if a user has the comboxOpen, and then clicks on a button, the comboBox closes but the button click is not handled.

Major Changes

Adjusted the UseOutsideClick hook to handle a "mousedown" event rather than a "click" event.

Testing/Validation

Manually tested using mouse and verified that keyboard interaction still works as expected.

@fmaddenflx fmaddenflx requested review from a team as code owners January 31, 2025 18:20
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to rename this hook, since it's no longer acting on "click" but rather "mousedown" ?

I think that perhaps we shouldn't rename it, because it's easier to remember that "hey I need to add an outside click handler to this thing" than it is to remember "hey I need to add a handler for mousedown to this thing."

@jamesobrooks
Copy link
Contributor

I'm not sure we need the comment, but looks good.

@fmaddenflx fmaddenflx merged commit bbd2c68 into main Jan 31, 2025
19 checks passed
@fmaddenflx fmaddenflx deleted the CAMS-516-combobox-click-outside-closes-dropdown branch January 31, 2025 19:33
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

Successfully merging this pull request may close these issues.

3 participants