-
Notifications
You must be signed in to change notification settings - Fork 116
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
Ensure pressing 'Enter' in SelectPanel filter input causes navigation if first item is link #2978
Conversation
… if first item is link
🦋 Changeset detectedLatest commit: cc1b9c0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
I tested in Lookbook and discovered a niche bug. In the single select playground example, if you select an item via the input, then filter the input by some text and select a different item, both items are selected when you reopen the panel. |
Still seeing the same issue: CleanShot.2024-07-30.at.16.07.32.mp4Alt: On storybook |
…r/view_components into select_panel_enter_should_navigate
Alright, we ended up removing the piggybacking code designed to fix issues where a user's selections would be overridden by server-rendered selections. This PR now only contains fixes for the issue in the title + description. |
Authors: Please fill out this form carefully and completely.
Reviewers: By approving this Pull Request you are approving the code change, as well as its deployment and mitigation plans.
Please read this description carefully. If you feel there is anything unclear or missing, please ask for updates.
What are you trying to accomplish?
In a previous PR, I added functionality to ensure that pressing Enter while focused on the filter input of a
SelectPanel
selects the first list item, in accordance with our API docs for the component. However, the methodology I chose did not account for the case when list items are links, i.e. anchor elements. This PR simulates aclick
event instead, so everything works as expected even when list items are links.Screenshots
The video below shows that pressing Enter while focused on the filter input navigates to the URL specified in the anchor tag for the first list item, which is https://github.com.
selectpanel_enter.mov
Integration
No changes necessary in production.
Risk Assessment
Accessibility
Merge checklist
- [ ] Added/updated documentationTake a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.