searchable-option-list
searchable-option-list copied to clipboard
Issue with search when select option tooltip is undefined
Issue: Unexpected results with search Problem: select option item tooltip string is included in the search, but tooltip is undefined.
Line 541 (sol.js v 2.0.2):
elementSearchableTerms = (item.label + ' ' + item.tooltip).trim().toLowerCase();
adds "undefined" to the search string.
For example, elementSearchableTerms for option label "Apple" is "apple undefined" so potentially wrong items displayed when searching for any of these characters: "u","n","d","e","f","i","n","e"
My solution: change line to exclude tooltip in search:
elementSearchableTerms = (item.label).trim().toLowerCase();