1
0
Fork 0
mirror of synced 2024-08-23 22:11:39 +12:00

Color invalid options grey in grids

This commit is contained in:
Andrew Kingston 2024-05-23 15:59:04 +01:00
parent de78f1a242
commit 1156209399

View file

@ -13,6 +13,8 @@
export let api export let api
export let contentLines = 1 export let contentLines = 1
const InvalidColor = "hsla(0, 0%, 70%, 0.3)"
let isOpen = false let isOpen = false
let focusedOptionIdx = null let focusedOptionIdx = null
let anchor let anchor
@ -40,7 +42,7 @@
const getOptionColor = value => { const getOptionColor = value => {
let idx = value ? options.indexOf(value) : null let idx = value ? options.indexOf(value) : null
if (idx == null || idx === -1) { if (idx == null || idx === -1) {
idx = 0 return InvalidColor
} }
return OptionColours[idx % OptionColours.length] return OptionColours[idx % OptionColours.length]
} }