Skip to content

Commit

Permalink
updated GitHubLabel.tsx example for issue #21333
Browse files Browse the repository at this point in the history
  • Loading branch information
matthenschke authored and oliviertassinari committed Jun 15, 2020
1 parent c6b95d2 commit b995bcb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/src/pages/components/autocomplete/GitHubLabel.tsx
Expand Up @@ -187,7 +187,13 @@ export default function GitHubLabel() {
popperDisablePortal: classes.popperDisablePortal,
}}
value={pendingValue}
onChange={(event, newValue) => {
onChange={(event, newValue, reason) => {
if (
event.type === 'keydown' &&
(event as React.KeyboardEvent).key === 'Backspace' &&
reason === 'remove-option'
)
return;
setPendingValue(newValue);
}}
disableCloseOnSelect
Expand Down

0 comments on commit b995bcb

Please sign in to comment.