update findBestHint function#813
Conversation
solve the "Cannot read property 'toLowerCase' of undefined" issue with findBestHint function when suggestion.value doesn't exist
| if (foundMatch) { | ||
| bestMatch = suggestion; | ||
| var foundMatch = false; | ||
| if (suggestion.value !== undefined) { |
There was a problem hiding this comment.
Why would suggestion value be undefined?
There was a problem hiding this comment.
I don't know exactly, I didn't try to understand why, but it happens when hitting the backward key and causes the error.
|
Thanks for this contribution, and apologies for the very long silence. The project was dormant for several years and has just shipped v2.0, which is a ground-up TypeScript rewrite with a new build (esbuild), test runner (Vitest + jsdom), and CI pipeline. As a result this PR no longer applies cleanly against I'm closing it as part of a triage pass on the long-stale PR backlog — not because the idea lacks merit. If this change is still valuable to you against 2.0, please open a fresh PR (or an issue first if you'd like to confirm direction); I'll review new submissions against the current codebase promptly. Thanks again for taking the time. |
Hello,
When hitting the backward key in the search input I got a "Cannot read property 'toLowerCase' of undefined" error.
I solved the issue with editing the findBestHint function when suggestion.value doesn't exist.
Thanks