mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-30 19:08:48 +00:00
handling dpad navigation in input dropped
This commit is contained in:
parent
a4c474a33b
commit
575b469735
2 changed files with 0 additions and 13 deletions
|
|
@ -5,7 +5,6 @@ const useTabIndex = require('../useTabIndex');
|
|||
const styles = require('./styles');
|
||||
|
||||
const ENTER_KEY_CODE = 13;
|
||||
const ARROW_KEY_CODE = { 37: 'left', 38: 'up', 39: 'right', 40: 'down' };
|
||||
|
||||
const Input = React.forwardRef((props, ref) => {
|
||||
const tabIndex = useTabIndex(props.tabIndex, props.disabled);
|
||||
|
|
@ -18,15 +17,6 @@ const Input = React.forwardRef((props, ref) => {
|
|||
props.onSubmit(event);
|
||||
}
|
||||
}, [props.onKeyUp, props.onSubmit]);
|
||||
const onKeyDown = React.useCallback((event) => {
|
||||
if (ARROW_KEY_CODE[event.keyCode]) {
|
||||
event.stopPropagation();
|
||||
if (event.shiftKey) {
|
||||
event.preventDefault();
|
||||
window.navigate(ARROW_KEY_CODE[event.keyCode]);
|
||||
}
|
||||
}
|
||||
}, [props.onKeyDown]);
|
||||
return (
|
||||
<input
|
||||
{...props}
|
||||
|
|
@ -34,7 +24,6 @@ const Input = React.forwardRef((props, ref) => {
|
|||
className={classnames(props.className, styles['input-container'], { 'disabled': props.disabled })}
|
||||
tabIndex={tabIndex}
|
||||
onKeyUp={onKeyUp}
|
||||
onKeyDown={onKeyDown}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
|
@ -46,7 +35,6 @@ Input.propTypes = {
|
|||
tabIndex: PropTypes.number,
|
||||
disabled: PropTypes.bool,
|
||||
onKeyUp: PropTypes.func,
|
||||
onKeyDown: PropTypes.func,
|
||||
onSubmit: PropTypes.func
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
.input-container {
|
||||
--spatial-navigation-action: focus;
|
||||
user-select: text;
|
||||
|
||||
&::-moz-focus-inner {
|
||||
|
|
|
|||
Loading…
Reference in a new issue