Skip to content

HTMLSelectElement selectedOptions Property #6096

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
crash-dive opened this issue Dec 14, 2015 · 1 comment
Closed

HTMLSelectElement selectedOptions Property #6096

crash-dive opened this issue Dec 14, 2015 · 1 comment
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

Comments

@crash-dive
Copy link

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?

@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Help Wanted You can do this Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript labels Dec 14, 2015
@DanielRosenwasser DanielRosenwasser added this to the Community milestone Dec 16, 2015
@DanielRosenwasser
Copy link
Member

Thanks @crash-dive!

@DanielRosenwasser DanielRosenwasser added the Fixed A PR has been merged for this issue label Dec 16, 2015
@mhegazy mhegazy modified the milestones: TypeScript 1.8, Community Jan 5, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
Projects
None yet
Development

No branches or pull requests

5 participants