diff --git a/src/baredom/components/x_select/x_select.cljs b/src/baredom/components/x_select/x_select.cljs index 92eee2c6..ee4ac893 100644 --- a/src/baredom/components/x_select/x_select.cljs +++ b/src/baredom/components/x_select/x_select.cljs @@ -398,8 +398,50 @@ ;; Element class and registration ;; --------------------------------------------------------------------------- +(defn- option-value-present? + "True when the inner contract and +;; what every other BareDOM form control honours (x-form's collect-values and direct +;; `el.value` readers depend on it). The reflecting accessor install-properties! would give +;; reads the `value` ATTRIBUTE, which a user selection never updates, so override `value` +;; with a getter that reads the live inner — +;; surface that as pending via the attribute until the option arrives and apply-model! +;; selects it. (`value-attr-not-auto-set-on-change-test` still holds: a user change updates +;; only the inner (defn init! [] (component/register! model/tag-name diff --git a/test/baredom/components/x_select/x_select_test.cljs b/test/baredom/components/x_select/x_select_test.cljs index 9c0cfa3d..54817fbe 100644 --- a/test/baredom/components/x_select/x_select_test.cljs +++ b/test/baredom/components/x_select/x_select_test.cljs @@ -324,6 +324,47 @@ 0)) 0)))) +;; Conforming behaviour: `el.value` reflects the user's CURRENT selection (native