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: focus issue in filterable multiselect #16840

Conversation

riddhybansal
Copy link
Contributor

Closes #16830

Focus issue in filterable multiselect

Changelog

New

  • Added onBlur

Testing / Reviewing

Test filterable multiselect , it should work as intended.
Using the Storybook Filterable, if you click in the select and type opt ... then try clicking on the (x) clear button, it should work , and it should lose focus after clicking outside.

Please verify this PR does not create another issue that has been closed already #16145

@riddhybansal riddhybansal requested a review from a team as a code owner June 21, 2024 09:17
Copy link

netlify bot commented Jun 21, 2024

Deploy Preview for v11-carbon-react ready!

Name Link
🔨 Latest commit 0574970
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/667c477f5527b900080c36a2
😎 Deploy Preview https://deploy-preview-16840--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jun 21, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 0574970
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/667c477f20e715000802e313
😎 Deploy Preview https://deploy-preview-16840--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@riddhybansal
Copy link
Contributor Author

My only concerned over here is , is this the intended behaviour - when the filterable multiselect is opened clicking outside first closes the menu , and focus remains on input field to type something and then clicking outside again clears the focus.

@Gururajj77
Copy link
Contributor

Gururajj77 commented Jun 21, 2024

@riddhybansal , clicking the (x) button isn't clearing the text box or clearing the selected options, is that intended behaviour?? Please correct me if I've missed something

Screen.Recording.2024-06-21.at.4.39.54.PM.mov

@alisonjoseph
Copy link
Member

alisonjoseph commented Jun 21, 2024

I'm also seeing the same issue as @Gururajj77 the focus is removed when you click outside, but the clear button doesn't do anything. (we need a test for this)

@guidari
Copy link
Contributor

guidari commented Jun 21, 2024

My only concerned over here is , is this the intended behaviour - when the filterable multiselect is opened clicking outside first closes the menu , and focus remains on input field to type something and then clicking outside again clears the focus.

Also looks like the focus doesn't go away when we are tabbing out from the ListBoxMenu, maybe if we add an onBlur there it would fix your comment and the tab navigation...

@riddhybansal , clicking the (x) button isn't clearing the text box or clearing the selected options, is that intended behaviour?? Please correct me if I've missed something

Good catch. In the 1.59.0 is working as expected the close icon.

We should also write tests for those two scenarios, to avoid any changes that might affect that in the future.

@guidari guidari added this pull request to the merge queue Jun 26, 2024
Merged via the queue into carbon-design-system:main with commit 3636b9f Jun 26, 2024
22 checks passed
tay1orjones added a commit to tay1orjones/carbon that referenced this pull request Jun 26, 2024
* fix: focus issue in filterable multiselect

* fix: added test cases and focus fixes

* Update FilterableMultiSelect-test.js

* Update FilterableMultiSelect-test.js

* Update MultiSelect.stories.js

* Update packages/react/src/components/MultiSelect/FilterableMultiSelect.tsx

---------

Co-authored-by: Taylor Jones <[email protected]>
@tay1orjones tay1orjones mentioned this pull request Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Focus on FilterableMultiSelect always persists once click on the control
5 participants