Skip to content

Commit

Permalink
Fix aria-label of output format
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Mar 2, 2024
1 parent d5a199f commit 05a5938
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions view/code/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,17 @@ function listenChanges(input: HTMLInputElement): void {
listenChanges(lchInput)
listenChanges(rgbInput)

format.value = outputFormat.get()
outputFormat.listen(value => {
outputFormat.subscribe(value => {
format.value = value
if (value === 'numbers') {
rgb.ariaLabel = `OKLCH ${value}`
rgbInput.ariaLabel = `OKLCH ${value}`
} else if (value === 'lrgb') {
rgb.ariaLabel = `Linear RGB ${value}`
rgbInput.ariaLabel = `Linear RGB`
} else {
rgb.ariaLabel = `${value} CSS code`
rgbInput.ariaLabel = `${value} CSS code`
}
})
outputFormat.listen(() => {
setRgb()
})
format.addEventListener('change', () => {
Expand Down

0 comments on commit 05a5938

Please sign in to comment.