searchable-option-list icon indicating copy to clipboard operation
searchable-option-list copied to clipboard

Issue with search when select option tooltip is undefined

Open roying opened this issue 7 years ago • 0 comments

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();

roying avatar Nov 20 '18 19:11 roying