From e501325c7841d6aedd9b0e8db5584672bc5976fd Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 10 Dec 2019 12:01:52 +0100 Subject: [PATCH] [Select] Fix listbox closing on Space keyUp (#18754) --- .../material-ui/src/ButtonBase/ButtonBase.js | 17 ++++++++++-- .../src/ButtonBase/ButtonBase.test.js | 26 +++++++++++++++++++ .../material-ui/src/Select/Select.test.js | 22 +++++++++++++++- .../material-ui/src/Select/SelectInput.js | 12 +++++++++ 4 files changed, 74 insertions(+), 3 deletions(-) diff --git a/packages/material-ui/src/ButtonBase/ButtonBase.js b/packages/material-ui/src/ButtonBase/ButtonBase.js index 3ede2ac48cb913..f34c7002808023 100644 --- a/packages/material-ui/src/ButtonBase/ButtonBase.js +++ b/packages/material-ui/src/ButtonBase/ButtonBase.js @@ -219,7 +219,15 @@ const ButtonBase = React.forwardRef(function ButtonBase(props, ref) { } }); const handleKeyUp = useEventCallback(event => { - if (focusRipple && event.key === ' ' && rippleRef.current && focusVisible) { + // calling preventDefault in keyUp on a