From ff13ec2f603365452bc674e8b755e4887370e956 Mon Sep 17 00:00:00 2001 From: Connor Finley Date: Wed, 8 Nov 2023 17:55:31 -0500 Subject: [PATCH] Add default select option for midi selection Otherwise the on-change handler never fires if there's only one option --- src/why_does_that_sound_good/components/settings_panel.cljs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/why_does_that_sound_good/components/settings_panel.cljs b/src/why_does_that_sound_good/components/settings_panel.cljs index fd57a13..4cc9f62 100644 --- a/src/why_does_that_sound_good/components/settings_panel.cljs +++ b/src/why_does_that_sound_good/components/settings_panel.cljs @@ -19,6 +19,7 @@ [: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)])]] @@ -26,6 +27,7 @@ [: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)])]]