Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent search from closing when using a virtual keyboard #2667

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/renderer/components/top-nav/top-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export default Vue.extend({
}
},
mounted: function () {
let previousWidth = window.innerWidth
if (window.innerWidth <= 680) {
this.showSearchContainer = false
}
Expand All @@ -88,7 +89,12 @@ export default Vue.extend({
}, 0)

window.addEventListener('resize', () => {
this.showSearchContainer = window.innerWidth > 680
// Don't change the status of showSearchContainer if only the height of the window changes
// Opening the virtual keyboard can trigger this resize event, but it won't change the width
if (previousWidth !== window.innerWidth) {
this.showSearchContainer = window.innerWidth > 680
previousWidth = window.innerWidth
}
})

this.debounceSearchResults = debounce(this.getSearchSuggestions, 200)
Expand Down