From 4ec71d43aea22acfca4c44301b22df9b15924ced Mon Sep 17 00:00:00 2001 From: NikolaBorislavovHristov Date: Thu, 1 Aug 2019 16:02:14 +0300 Subject: [PATCH] event.handled replaced with more describing prop name --- src/common/Popup/Popup.js | 4 ++-- src/navigation/Input/Input.js | 4 ++-- src/routes/Intro/ConsentCheckbox/ConsentCheckbox.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/Popup/Popup.js b/src/common/Popup/Popup.js index 5ba65cf5d..9a0da2237 100644 --- a/src/common/Popup/Popup.js +++ b/src/common/Popup/Popup.js @@ -219,11 +219,11 @@ class Popup extends React.Component { } menuContainerOnClick = (event) => { - event.nativeEvent.handled = true; + event.nativeEvent.closePrevented = true; } modalBackgroundOnClick = (event) => { - if (!event.nativeEvent.handled) { + if (!event.nativeEvent.closePrevented) { this.close(); } } diff --git a/src/navigation/Input/Input.js b/src/navigation/Input/Input.js index 033530e34..1c38f9059 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.nativeEvent.handled && event.keyCode === ENTER_KEY_CODE) { + if (!event.nativeEvent.submitPrevented && 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.nativeEvent.handled && BUTTON_INPUT_TYPES.includes(type)) { + if (!event.nativeEvent.blurPrevented && 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 f818afa1e..a9d780a9f 100644 --- a/src/routes/Intro/ConsentCheckbox/ConsentCheckbox.js +++ b/src/routes/Intro/ConsentCheckbox/ConsentCheckbox.js @@ -7,12 +7,12 @@ require('./styles'); const ConsentCheckbox = React.forwardRef(({ className, checked, label, link, href, toggle }, ref) => { const checkboxOnClick = React.useCallback((event) => { - if (!event.nativeEvent.handled && typeof toggle === 'function') { + if (!event.nativeEvent.togglePrevented && typeof toggle === 'function') { toggle(event); } }, [toggle]); const linkOnClick = React.useCallback((event) => { - event.nativeEvent.handled = true; + event.nativeEvent.togglePrevented = true; }, []); return (