Skip to content

Commit

Permalink
Fix toggle button label
Browse files Browse the repository at this point in the history
I missed labeling "off" for the off state. Now not just the color
will specify the state.
  • Loading branch information
morrna committed Nov 10, 2024
1 parent 0d62786 commit 5960d45
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Command/Components.elm
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,12 @@ toggle label sendToggle current
then (Css.rgb 0 128 0)
else (Css.rgb 128 0 0)
]
labelText
= if current then "on" else "off"
in
[
HS.h4 [] [HS.text label]
, HS.button [HSE.onClick sendToggle, pressed, style] [HS.text "on"]
, HS.button [HSE.onClick sendToggle, pressed, style] [HS.text labelText]
]

{-| A list of choices as a dropdown -}
Expand Down

0 comments on commit 5960d45

Please sign in to comment.