Skip to content

Binding selected to <option>s via handlebars values doesn't add attributes #15709

Closed
@Kerrick

Description

@Kerrick

Ember Twiddle

If you have the following Handlebars in an Ember application:

<select>
  <option disabled>--Select One--</option>
  <option>hello</option>
  <option selected={{true}}>goodbye</option>
  <option>maybe</option>
</select>

You'd expect the "goodbye" option to be selected and to have a selected boolean HTML attribute. It is selected, but it does not have the attribute. This means you do indeed see the "goodbye" in a closed select menu, but using CSS to style option[selected] does not work because the attribute is missing.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions