Skip to content

Commit

Permalink
[useAutocomplete] Handle Opera fullscreen mode (#18275)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssliman authored and oliviertassinari committed Nov 8, 2019
1 parent 33eef4f commit 0050cb8
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -537,9 +537,15 @@ export default function useAutocomplete(props) {
break;
case 'Escape':
if (popupOpen) {
// Avoid Opera to exit fullscreen mode.
event.preventDefault();
// Avoid the Modal to handle the event.
event.stopPropagation();
handleClose(event);
} else if (clearOnEscape) {
} else if (clearOnEscape && inputValue !== '') {
// Avoid Opera to exit fullscreen mode.
event.preventDefault();
// Avoid the Modal to handle the event.
event.stopPropagation();
handleClear(event);
}
Expand Down

0 comments on commit 0050cb8

Please sign in to comment.