HTMLSelectElement.options should be an HTMLOptionsCollection, not HTMLCollection #8220
Labels
Bug
A bug in TypeScript
Domain: lib.d.ts
The issue relates to the different libraries shipped with TypeScript
Fixed
A PR has been merged for this issue
Help Wanted
You can do this
Milestone
According to
https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement
the options property should be an HTMLOptionsCollection
https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptionsCollection
Which is just like an HTMLCollection but all the options are HTMLOptionElement.
This allows code like
to work without needing to coerce
select.options[0]
to aHTMLOptionElement
.See also this (closed) issue for some background -- I think the type of this got a bit funky at one point due to a bug in Edge that was fixed: #1558
The text was updated successfully, but these errors were encountered: