Add final check.
This commit is contained in:
parent
b8c7da02e2
commit
45c040803f
|
@ -42,7 +42,7 @@
|
||||||
}
|
}
|
||||||
const index = options.findIndex((option, idx) => {
|
const index = options.findIndex((option, idx) => {
|
||||||
const opt = getOptionValue(option, idx)
|
const opt = getOptionValue(option, idx)
|
||||||
return compare ? compare(opt, value) : opt === value
|
return typeof compare === "function" ? compare(opt, value) : opt === value
|
||||||
})
|
})
|
||||||
return index !== -1 ? getAttribute(options[index], index) : null
|
return index !== -1 ? getAttribute(options[index], index) : null
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue