HTMLSelectElement selectedOptions Property #6096
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
The HTMLSelectElement interface does not implement the selectedOptions property. This should be a collection of HTMLOptionElement which are currently selected and can be found in the spec here: http://www.w3.org/TR/html5/forms.html#the-select-element
This SO question suggests it is implemented in all major browsers: http://stackoverflow.com/questions/10711767/is-selectedoptions-broken-or
However it does not mention Edge. I unfortunately do not have access to Edge at the moment so I cannot test it if someone can that would be great. The generated XML here does not have the property https://github.com/Microsoft/TSJS-lib-generator/blob/master/inputfiles/browser.webidl.xml.
It does not seem like it should be hard to fix just add another property after https://github.com/Microsoft/TSJS-lib-generator/blob/master/inputfiles/overridingTypes.json#L228
{
"kind": "property",
"interface": "HTMLSelectElement",
"name": "selectedOptions",
"type": "HTMLCollection"
}
Ideally you would want it to be typed so it only returns a HTMLOptionElement in a similar way to how NodeListOf would work but it does not seem like there is a HTMLCollectionOf interface (this also applies to the options property). Perhaps that should be added maybe I should raise a separate issue for that?
The text was updated successfully, but these errors were encountered: