Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Textarea contents not getting updated correctly? #39

Open
pb- opened this issue Oct 13, 2022 · 0 comments
Open

Textarea contents not getting updated correctly? #39

pb- opened this issue Oct 13, 2022 · 0 comments

Comments

@pb-
Copy link

pb- commented Oct 13, 2022

I'm defining a textarea like this

(declare reset)

(defcomponent demo [text]
  [:div
   [:textarea text]
   [:button {:onclick #(reset "hi world")} "reset"]])

(defn reset [s]
  (dumdom/render [demo s] (js/document.getElementById "app")))

(reset "hello world")

After loading the page, clicking reset works as expected: the textarea's contents changes from hello world to hi world. However, if I modify the textarea's contents prior to clicking reset, nothing happens. The issue appears to be related to the text being a child element of the textarea - an analogous version with an input element and a value attribute works as expected.

Should I be expecting this behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant