mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 17:15:48 +00:00
event.handled replaced with more describing prop name
This commit is contained in:
parent
863854b6c1
commit
4ec71d43ae
3 changed files with 6 additions and 6 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<Checkbox ref={ref} className={classnames(className, 'consent-checkbox-container', 'focusable-with-border')} checked={checked} onClick={checkboxOnClick}>
|
||||
|
|
|
|||
Loading…
Reference in a new issue