Skip to content

HTMLSelectElement selectedOptions Property #6096

Description

@crash-dive

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueHelp WantedYou can do this

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions