Revert "Quick fix, if compare isn't set then don't try to use it at all."

This reverts commit b8c7da02e2.
This commit is contained in:
Mel O'Hagan 2024-01-26 10:00:19 +00:00
parent 0efe0bb7ac
commit 0c09d5878b
1 changed files with 2 additions and 2 deletions

View File

@ -12,7 +12,7 @@
export let getOptionIcon = () => null export let getOptionIcon = () => null
export let getOptionColour = () => null export let getOptionColour = () => null
export let getOptionSubtitle = () => null export let getOptionSubtitle = () => null
export let compare = null export let compare = (option, value) => option === value
export let useOptionIconImage = false export let useOptionIconImage = false
export let isOptionEnabled export let isOptionEnabled
export let readonly = false export let readonly = false
@ -45,7 +45,7 @@
return "" return ""
} }
const index = options.findIndex((option, idx) => const index = options.findIndex((option, idx) =>
compareOptionAndValue(getOptionValue(option, idx), value) compare(getOptionValue(option, idx), value)
) )
return index !== -1 ? getAttribute(options[index], index) : null return index !== -1 ? getAttribute(options[index], index) : null
} }