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

Serialize textarea value correctly #518

Open
lydell opened this issue Feb 6, 2025 · 1 comment
Open

Serialize textarea value correctly #518

lydell opened this issue Feb 6, 2025 · 1 comment

Comments

@lydell
Copy link
Contributor

lydell commented Feb 6, 2025

Currently, Html.textarea [ Html.Attributes.value "my value" ] [] is serialized as HTML as <textarea value="my value"></textarea>. However, that results in an empty textarea in HTML. The correct serialization is <textarea>my value</textarea>.

For full completeness, elm/virtual-dom also needs to support going the other way: When virtualizing, it should create vdom for Html.textarea [ Html.Attributes.value "my value" ] [], not Html.textarea [] [ Html.text "my value" ]. My to-be-released fork of elm/virtual-dom does this.

@dillonkearns
Copy link
Owner

Makes sense, thank you for the issue!

The HTML serialization code here is originally from the elm-test codebase, and I try to keep it in lockstep as much as possible. For example, I made a fix a while ago and made a PR over there elm-explorations/test#212. Would be nice to do the same for this.

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

2 participants