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

Adding check for null-values in onMutation #654

Merged
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
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