Skip to content

Commit

Permalink
Add default select option for midi selection
Browse files Browse the repository at this point in the history
Otherwise the on-change handler never fires if there's only one option
  • Loading branch information
cofinley authored Nov 8, 2023
1 parent eda4953 commit ff13ec2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/why_does_that_sound_good/components/settings_panel.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@
[:select.flex.p-2.rounded.dark:bg-neutral-700.dark:text-neutral-100.border.dark:border-neutral-500
{:on-change #(re-frame/dispatch [::events/on-midi-select-input (-> % .-target .-value)])
:value (if (nil? current-input) "" current-input)}
[:option "Select"]
(for [input inputs]
^{:key (.-id input)}
[:option (.-name input)])]]
[:label.font-bold "MIDI Output"
[:select.flex.p-2.rounded.dark:bg-neutral-700.dark:text-neutral-100.border.dark:border-neutral-500
{:on-change #(re-frame/dispatch [::events/on-midi-select-output (-> % .-target .-value)])
:value (if (nil? current-output) "" current-output)}
[:option "Select"]
(for [output outputs]
^{:key (.-id output)}
[:option (.-name output)])]]
Expand Down

0 comments on commit ff13ec2

Please sign in to comment.