From 475dbc6b3793af579521a6ec6be2e0c21c53de50 Mon Sep 17 00:00:00 2001 From: Mark Eibes Date: Tue, 25 Apr 2023 09:03:58 +0200 Subject: [PATCH] Make select properly controlled --- .idea/tailwindcss.xml | 6 ++++++ src/Yoga/Block/Atom/Select/View.purs | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .idea/tailwindcss.xml diff --git a/.idea/tailwindcss.xml b/.idea/tailwindcss.xml new file mode 100644 index 0000000..5c262b5 --- /dev/null +++ b/.idea/tailwindcss.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/src/Yoga/Block/Atom/Select/View.purs b/src/Yoga/Block/Atom/Select/View.purs index b37f2de..98a6b8a 100644 --- a/src/Yoga/Block/Atom/Select/View.purs +++ b/src/Yoga/Block/Atom/Select/View.purs @@ -18,7 +18,7 @@ type Props a = component ∷ ∀ a. ReactComponent (Props a) component = unsafePerformEffect do - React.reactComponent "Select" \{ toString, toValue, choices, onChange } → + React.reactComponent "Select" \{ toString, toValue, choice, choices, onChange } → React.do pure $ div "input-container" Style.container @@ -27,6 +27,7 @@ component = unsafePerformEffect do { className: "select" , role: "listbox" , css: Style.select + , value: toValue choice , onChange: handler targetValue \maybeVal → traverse_ onChange do val ← maybeVal