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

fix(dropdowns): compose onKeyDown handler for multiselect #1277

Merged
merged 1 commit into from
Jan 25, 2022

Conversation

hzhu
Copy link
Contributor

@hzhu hzhu commented Jan 24, 2022

Description

Since #1176, some of Garden's dropdown behaviors have changed slightly. This pull request addresses a small difference in behavior for the Multiselect component which results in a bug for some consumers.

Detail

When consumers pass in an onKeyDown handler, it overrides Garden's internal onKeyDown code causing problems searching the multiselect. One example is that the Space key is not registered. Try searching for an item with a space in this example.

Although, consumers should use onInputChange as shown on the API docs, the Multiselect component should still register the key strokes as expected if they choose to add an onKeyDown handler.

This PR addresses the issue by composing the onKeyDown handlers if it is passed into the component.

Checklist

  • 🌐 demo is up-to-date (yarn start)
  • ⬅️ renders as expected with reversed (RTL) direction
  • 🀘 renders as expected with Bedrock CSS (?bedrock)
  • β™Ώ analyzed via axe and evaluated using VoiceOver
  • πŸ’‚β€β™‚οΈ includes new unit tests
  • πŸ“ tested in Chrome, Firefox, Safari, Edge, and IE11

@hzhu hzhu self-assigned this Jan 24, 2022
@hzhu hzhu marked this pull request as ready for review January 24, 2022 19:18
@hzhu hzhu requested a review from a team as a code owner January 24, 2022 19:18
@hzhu hzhu requested review from a team and removed request for a team January 24, 2022 19:19
@coveralls
Copy link

Coverage Status

Coverage remained the same at 95.765% when pulling ab5b39b on hzhu/multiselect-fix into 63d4d12 on main.

@hzhu hzhu merged commit 1664050 into main Jan 25, 2022
@hzhu hzhu deleted the hzhu/multiselect-fix branch January 25, 2022 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

5 participants