Merge branch 'master' into refactor/remove-field-types
This commit is contained in:
commit
48ea140998
|
@ -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 = (option, value) => option === value
|
export let compare = null
|
||||||
export let useOptionIconImage = false
|
export let useOptionIconImage = false
|
||||||
export let isOptionEnabled
|
export let isOptionEnabled
|
||||||
export let readonly = false
|
export let readonly = false
|
||||||
|
@ -40,9 +40,10 @@
|
||||||
if (!options?.length) {
|
if (!options?.length) {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
const index = options.findIndex((option, idx) =>
|
const index = options.findIndex((option, idx) => {
|
||||||
compare(getOptionValue(option, idx), value)
|
const opt = getOptionValue(option, idx)
|
||||||
)
|
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