Searching now hides the navigation menu

This commit is contained in:
nogafam.es Admin 2021-10-26 00:18:22 +02:00
parent 4c0249c2a8
commit eb90140a60
1 changed files with 10 additions and 0 deletions

View File

@ -83,11 +83,21 @@ class Search extends React.PureComponent {
}
}
hideMenu() {
var width = (window.innerWidth > 0) ? window.innerWidth : screen.width;
if (width <= 720) {
document.querySelector('.columns-area__panels__pane--navigational').className += ' visible';
document.querySelector('div.search').className += ' visible';
document.getElementById('menu-toggle-button').className = '';
}
}
handleKeyUp = (e) => {
if (e.key === 'Enter') {
e.preventDefault();
this.props.onSubmit();
this.hideMenu();
if (this.props.openInRoute) {
this.context.router.history.push('/search');