Debug unresponsive button press for selectKey

Observed problem: Tapping "C major, A minor" key, which LPC sets by default,
does not unset it.

Bug: handleClick passed the relativeMinor Key but the default value in
State.Model is the C Major key. We would toggled b/w [Cmajor] ->
[Cmajor,Aminor], and because toggled checked if either Cmajor or Aminor was
present, it was always true.

Solution: Check relativeMajor to set toggled.
This commit is contained in:
William Carroll 2020-04-18 18:51:23 +01:00
parent 441fe3e32e
commit 82ebc0ad19

View file

@ -28,9 +28,9 @@ selectKey model { relativeMajor, relativeMinor } =
div [ class "flex pt-0" ]
[ UI.textToggleButton
{ label = buttonLabel relativeMajor relativeMinor
, handleClick = State.ToggleKey relativeMinor
, handleClick = State.ToggleKey relativeMajor
, classes = [ "flex-1" ]
, toggled = active relativeMinor || active relativeMajor
, toggled = active relativeMajor
}
]