From f5c77d71cc745e4f07fe2f9ca11f2d8a6b3e1d6f Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 9 Dec 2019 12:20:28 +0100 Subject: [PATCH 1/2] [ButtonBase] Respect defaultPrevented in keyUp --- .../material-ui/src/ButtonBase/ButtonBase.js | 17 ++++++++++-- .../src/ButtonBase/ButtonBase.test.js | 26 +++++++++++++++++++ 2 files changed, 41 insertions(+), 2 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