reagent-project/reagent-forms

Select input doesn't repaint selected value when state is changed externally

Open

#19 geöffnet am 7. Nov. 2014

Auf GitHub ansehen
 (21 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)HTML (78 Forks)batch import
help wanted

Repository-Metriken

Stars
 (337 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

The :select list control doesn't display the correct value when initiated with state.

For example, if I pass `(atom {:status "P"}) into this form:

   (row "Status" [:select.form-control {:field :list :id :status}
                  [:option {:key "A"} "Active"]
                  [:option {:key "P"} "Paused"]
                  [:option {:key "X"} "Archived"]])

NOTE: I've tried both strings and keywords for the value of the :key attribute.

The form will render with the first option displayed ("Active"). The atom will continue to hold the value of "P" until the user selects a new value from the select.

The issue is also illustrated on the examples page where the select should display bar but instead displays foo.

I tested this in both the latest releases of Chrome and Firefox on OSX.

Contributor Guide