Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #654 from sindrebilden/patch/cores-suggest-on-muta…
Browse files Browse the repository at this point in the history
…tion

Adding check for null-values in onMutation
  • Loading branch information
skjalgepalg authored Aug 24, 2022
2 parents 3411a47 + 9e87bdb commit b64f9cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core-suggest/core-suggest.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ function toggleItem (item, show) {
function onMutation (self) {
if (!self._observer) return // Abort if disconnectedCallback has been called (this/self._observer is null)

const needle = self.input.value.toLowerCase().trim()
const needle = (self.input && self.input.value) ? self.input.value.toLowerCase().trim() : null
const items = self.querySelectorAll('a:not([hidden]),button:not([hidden])')
const limit = Math.min(items.length, self.limit)

Expand Down

0 comments on commit b64f9cf

Please sign in to comment.