lit / lit/lit.dev

Document that `<select>` will remove HTML Elements

Open
#1,360 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
142
Forks
230
PR merge metrics
No merged PRs in 30d

Description

The `HTMLSelectElement` has bespoke browser behavior that deletes `HTMLElement`s that are not `HTMLOptionElement`s. This means that binding to custom elements inside of a `` will throw runtime errors.

[See playground for behavior](https://lit.dev/playground/#project=W3sibmFtZSI6InNpbXBsZS1ncmVldGluZy50cyIsImNvbnRlbnQiOiJpbXBvcnQge2h0bWwsIGNzcywgTGl0RWxlbWVudH0gZnJvbSAnbGl0JztcbmltcG9ydCB7Y3VzdG9tRWxlbWVudCwgcHJvcGVydHl9IGZyb20gJ2xpdC9kZWNvcmF0b3JzLmpzJztcblxuQGN1c3RvbUVsZW1lbnQoJ3NpbXBsZS1ncmVldGluZycpXG5leHBvcnQgY2xhc3MgU2ltcGxlR3JlZXRpbmcgZXh0ZW5kcyBMaXRFbGVtZW50IHtcbiAgcmVuZGVyKCkge1xuICAgIHJldHVybiBodG1sYFxuICAgICAgICA8c2VsZWN0PlxuICAgICAgICAgICR7WzEsMiwzLDQsNV0ubWFwKHZhbCA9PiBodG1sYDxvcHRpb24gdmFsdWU9JHt2YWx9PiR7dmFsfTwvb3B0aW9uPmApfVxuICAgICAgICAgIDxkaXY-RGl2IHdpbGwgYmUgcmVtb3ZlZCBhbmQgdGV4dCBjb250ZW50IGhvaXN0ZWQ8L2Rpdj5cbiAgICAgICAgICBUaGlzIGlzIGEgdGV4dCBub2RlLiBOb25lIG9mIHRoaXMgaXMgcmVuZGVyZWRcbiAgICAgICAgPC9zZWxlY3Q-YDtcbiAgfVxufVxuIn0seyJuYW1lIjoiaW5kZXguaHRtbCIsImNvbnRlbnQiOiI8IURPQ1RZUEUgaHRtbD5cbjxoZWFkPlxuICA8c2NyaXB0IHR5cGU9XCJtb2R1bGVcIiBzcmM9XCIuL3NpbXBsZS1ncmVldGluZy5qc1wiPjwvc2NyaXB0PlxuPC9oZWFkPlxuPGJvZHk-XG4gIDxzaW1wbGUtZ3JlZXRpbmcgbmFtZT1cIldvcmxkXCI-PC9zaW1wbGUtZ3JlZXRpbmc-XG48L2JvZHk-XG4ifSx7Im5hbWUiOiJwYWNrYWdlLmpzb24iLCJjb250ZW50Ijoie1xuICBcImRlcGVuZGVuY2llc1wiOiB7XG4gICAgXCJsaXRcIjogXCJeMy4wLjBcIixcbiAgICBcIkBsaXQvcmVhY3RpdmUtZWxlbWVudFwiOiBcIl4yLjAuMFwiLFxuICAgIFwibGl0LWVsZW1lbnRcIjogXCJeNC4wLjBcIixcbiAgICBcImxpdC1odG1sXCI6IFwiXjMuMC4wXCJcbiAgfVxufSIsImhpZGRlbiI6dHJ1ZX1d)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the behavior in the linked Lit playground and review the existing lit.dev documentation for guidance on select elements and custom elements. Document that non-option HTMLElements inside a select can be removed and cause runtime errors, with a link to the reproduction; done means the warning is easy to find and accurately describes the limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, typescript
Domain
documentation, web-dev
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.