-
Notifications
You must be signed in to change notification settings - Fork 830
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: allow OptionsList to not focus on the search bar #1528
Conversation
✅ Deploy Preview for evergreen-storybook ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
/** | ||
* When true, menu auto focuses on the search/filter bar. | ||
*/ | ||
shouldAutoFocus: PropTypes.bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add this to the SelectMenuProps
interface in index.d.ts
as well? (Listing @default true
might be helpful as well)
index.d.ts
Outdated
@@ -2387,6 +2387,10 @@ export interface SelectMenuProps extends Omit<PopoverProps, 'position' | 'conten | |||
* When true, show the filter. | |||
*/ | |||
hasFilter?: boolean | |||
/** | |||
* @default true. When true, auto focuses on the search/filter bar. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i see, thanks for the note!
Original Jira ticket: https://segment.atlassian.net/browse/PROT-4257
Loom: https://www.loom.com/share/79fd27a5ac2a415c93aac856c50c427a
Overview
There's a bug in Protocols tracking plan, where the focus of the input changes to the focus of the filter search bar. This happens because the tracking plan editor pages refreshes every few seconds and the focus is autofocused to the search bar component. This PR adds a prop
shouldAutoFocus
toOptionsList
so that we can disable the autofocus as needed. The change will not affect existing behaviors.Screenshots (if applicable)
Documentation