-
Notifications
You must be signed in to change notification settings - Fork 2.9k
SearchBox: Don't prevent Esc from propagating if the box is empty [v7.0] #16017
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
SearchBox: Don't prevent Esc from propagating if the box is empty [v7.0] #16017
Conversation
|
Note: I also have PR #16018 to fix this in master (the code has diverged enough that it's easier to just have separate PRs for v7 and master). |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit afcb3cf:
|
Perf AnalysisNo significant results to display. All results
|
Asset size changes
Baseline commit: 619dbd44312fa9fc85382f8213e77c1b2a392f91 (build) |
packages/office-ui-fabric-react/src/components/SearchBox/SearchBox.base.tsx
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/SearchBox/SearchBox.base.tsx
Show resolved
Hide resolved
…ack the call to stopPropagation if the onKeyDown handler calls preventDefault.
|
🎉 Handy links: |
Pull request checklist
$ yarn changeDescription of changes
SearchBox was always eating the Esc key, even if there was no text to clear from the search box. This prevented any parent components from handling the Esc key. For example, a dialog should dismiss when Esc is pressed on an empty search box in the dialog.
Fix: Don't handle the Esc key or call
onClearif the search box is empty.