Fix search not working on mobile because of undefined ref #6706
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix search not working on mobile because of undefined ref
Pull Request Type
Description
I noticed that there was an error happening on mobile when trying to search.
vue.runtime.esm.js:3106 TypeError: Cannot read properties of undefined (reading 'blur')
The line that traces back to is here:
FreeTube/src/renderer/components/top-nav/top-nav.js
Line 220 in bfa22f4
Looking into the component's template, I couldn't find a ref that matched it. Looking at the history, it looks like at one point the ref was on this element with the
searchContainer
class.8e72e7f#diff-07257d469f27c18e3d2c97c8c867fe787ee304ee7fbb6a3daffb80600a8183f9R71
This PR adds back this
ref="searchContainer"
to prevent that error and fix the search on mobile.Testing
Desktop
Additional context
i definitely have fixed this in my fork by just adding a null check, but looking into it, this seems like the true fix.