Fix issue with arrow keys switching movie when using them inside a textbox (or any element really)

pull/5081/head
nitsua 4 years ago committed by ta264
parent 081fe64bff
commit cf804f7dac

@ -177,6 +177,7 @@ class MovieDetails extends Component {
} }
onKeyUp = (event) => { onKeyUp = (event) => {
if (event.path.length === 4) {
if (event.keyCode === keyCodes.LEFT_ARROW) { if (event.keyCode === keyCodes.LEFT_ARROW) {
this.props.onGoToMovie(this.props.previousMovie.titleSlug); this.props.onGoToMovie(this.props.previousMovie.titleSlug);
} }
@ -184,6 +185,7 @@ class MovieDetails extends Component {
this.props.onGoToMovie(this.props.nextMovie.titleSlug); this.props.onGoToMovie(this.props.nextMovie.titleSlug);
} }
} }
}
onTouchStart = (event) => { onTouchStart = (event) => {
const touches = event.touches; const touches = event.touches;

Loading…
Cancel
Save