Skip to content

HTMLSelectElement selectedOptions Property #6096

Closed

Description

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?

Activity

  1. added this to the milestone on Dec 16, 2015
  2. DanielRosenwasser commented on Dec 16, 2015

    @DanielRosenwasser
    Member
  3. modified the milestones: TypeScript 1.8, on Jan 5, 2016
  4. locked and limited conversation to collaborators on Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions