From ca4e83148e9e1579d3b5e70006589df2b603dc71 Mon Sep 17 00:00:00 2001 From: NikolaBorislavovHristov Date: Tue, 4 Jun 2019 10:57:02 +0300 Subject: [PATCH] using nativeEvent to mark event as handled --- src/navigation/Input/Input.js | 4 ++-- src/routes/Intro/ConsentCheckbox/ConsentCheckbox.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/navigation/Input/Input.js b/src/navigation/Input/Input.js index c51176986..033530e34 100644 --- a/src/navigation/Input/Input.js +++ b/src/navigation/Input/Input.js @@ -21,7 +21,7 @@ const Input = React.forwardRef(({ type, tabIndex, children, ...props }, ref) => props.onKeyUp(event); } - if (!event.handled && event.keyCode === ENTER_KEY_CODE) { + if (!event.nativeEvent.handled && event.keyCode === ENTER_KEY_CODE) { if (BUTTON_INPUT_TYPES.includes(type)) { event.currentTarget.click(); } else if (TEXT_INPUT_TYPES.includes(type)) { @@ -36,7 +36,7 @@ const Input = React.forwardRef(({ type, tabIndex, children, ...props }, ref) => props.onMouseDown(event); } - if (!event.handled && BUTTON_INPUT_TYPES.includes(type)) { + if (!event.nativeEvent.handled && BUTTON_INPUT_TYPES.includes(type)) { event.preventDefault(); if (document.activeElement instanceof HTMLElement) { document.activeElement.blur(); diff --git a/src/routes/Intro/ConsentCheckbox/ConsentCheckbox.js b/src/routes/Intro/ConsentCheckbox/ConsentCheckbox.js index 6d1995aba..156cb0637 100644 --- a/src/routes/Intro/ConsentCheckbox/ConsentCheckbox.js +++ b/src/routes/Intro/ConsentCheckbox/ConsentCheckbox.js @@ -7,12 +7,12 @@ const styles = require('./styles'); const ConsentCheckbox = React.forwardRef(({ className, checked, label, link, href, toggle }, ref) => { const checkboxOnClick = React.useCallback((event) => { - if (!event.handled && typeof toggle === 'function') { + if (!event.nativeEvent.handled && typeof toggle === 'function') { toggle(event); } }, [toggle]); const linkOnClick = React.useCallback((event) => { - event.handled = true; + event.nativeEvent.handled = true; }, []); return (