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

Make interpolation of text-only tags more strict (e.g., “<textarea>”). #219

Open
theengineear opened this issue Nov 20, 2024 · 0 comments

Comments

@theengineear
Copy link
Collaborator

The textarea tag has different expectations from other elements. While it’s sensible to allow interpolation of the this element (e.g., to set the default value for this element as a form control) — being overly-lenient actually makes the interface worse. For example, we currently allow:

html`
  <textarea>
    ${someValue}
  </textarea>
`

…but, did the author mean the string \n ${someValue}\n ? Or, did they really mean just ${someValue}? Who’s to say…

It would be better if we instead threw an error in this case and required that integrators strictly write the template like this:

html`
  <textarea>${someValue}</textarea>
`

No room for interpretation 👌

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