Skip to content

Commit

Permalink
[bugfix] getWhitelistItem method did not take into consideration *w…
Browse files Browse the repository at this point in the history
…hitelist* array consisting of primitives of type `number`
  • Loading branch information
yairEO committed Apr 18, 2024
1 parent bcddc98 commit 99af32b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tagify.js
Expand Up @@ -936,11 +936,12 @@ Tagify.prototype = {
whitelist = whitelist || _s.whitelist;

whitelist.some(_wi => {
var _wiv = typeof _wi == 'string' ? _wi : (_wi[prop] || _wi.value),
// whitelist item value. Can be either a String, Number or an Object (with a `value` property)
var _wiv = typeof _wi == 'object' ? (_wi[prop] || _wi.value) : _wi,
isSameStr = sameStr(_wiv, value, _s.dropdown.caseSensitive, _s.trim)

if( isSameStr ){
result = typeof _wi == 'string' ? {value:_wi} : _wi
result = typeof _wi == 'object' ? _wi : {value:_wi}
return true
}
})
Expand Down

0 comments on commit 99af32b

Please sign in to comment.