From 8a1bb76ef661f76a2d640b9082eac0085c0b8e4d Mon Sep 17 00:00:00 2001 From: Chulgil Lee Date: Wed, 16 Sep 2026 01:54:58 +0900 Subject: [PATCH] :bug: Fix form select label resetting to its default option (#11664) select* resets its label to `default-selected` whenever its options change identity. The access token dialog builds its options vector inline, so picking an expiration re-rendered the dialog and the label snapped back to "Never", although the form kept the picked value and the token was created with it. form-select* now passes the form value as `default-selected` when it holds a non-blank string, so the reset lands on the picked option. The caller's default still applies while the form value is blank. Closes #11663 AI-assisted-by: claude-opus-5 Signed-off-by: chulgil <2044587+chulgil@users.noreply.github.com> Co-authored-by: chulgil <2044587+chulgil@users.noreply.github.com> Co-authored-by: Andrey Antukh --- frontend/src/app/main/ui/forms.cljs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/main/ui/forms.cljs b/frontend/src/app/main/ui/forms.cljs index b664d5dfe8..dbb158c160 100644 --- a/frontend/src/app/main/ui/forms.cljs +++ b/frontend/src/app/main/ui/forms.cljs @@ -204,7 +204,17 @@ props (mf/spread-props props {:on-change handle-change - :value value})] + :value value}) + + ;; select* resets its label to `default-selected` whenever its + ;; options change identity, and callers usually build the options + ;; inline, so every re-render snapped the label back to the default + ;; while the form kept the picked value. Pass the form value as the + ;; default so that reset lands on the picked option. + props + (if (and (string? value) (not (str/blank? value))) + (mf/spread-props props {:default-selected value}) + props)] [:> select* props]))