Skip to content

SelectElement's 'void add(Element element, Element before)' does not allow 'before' to be null. #2583

Closed
@ghost

Description

Passing null as 'before' should add the option element in front of the list:

SelectElement select = ...
select.add(new OptionElement("hey"), null);

Instead it throws an exception inside HTMLSelectElementImplementation.add:
Invalid class: expected instance HTMLElementImplementation

See also: http://api.dartlang.org/dom/HTMLSelectElement.html

Activity

ghost

ghost commented on Apr 16, 2012

@ghost

A workaround is:

select.elements.add(new OptionElement(".."));

vsmenon

vsmenon commented on Jul 12, 2012

@vsmenon
Member

Should we remove this method?


Added this to the M1 milestone.

iposva-google

iposva-google commented on Aug 13, 2012

@iposva-google
Contributor

Removed Area-DOM label.
Added Area-HTML label.

blois

blois commented on Sep 6, 2012

@blois

Set owner to @blois.
Added Accepted label.

blois

blois commented on Sep 7, 2012

@blois

I've removed the add method- the element collection should be used directly.


Added Fixed label.

ghost added
web-librariesIssues impacting dart:html, etc., libraries
on Sep 7, 2012
ghost added on Sep 7, 2012
ghost assigned on Sep 7, 2012
ghost added this to the M1 milestone on Sep 7, 2012
added a commit that references this issue on Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

web-librariesIssues impacting dart:html, etc., libraries

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @vsmenon@blois@iposva-google

      Issue actions

        SelectElement's 'void add(Element element, Element before)' does not allow 'before' to be null. · Issue #2583 · dart-lang/sdk