Setting selected attribute of multiple <option> tags in a multi select does not work properly #2247

Closed
alexssung opened this Issue Feb 5, 2017 · 3 comments

Comments

Projects
None yet
4 participants
@alexssung

alexssung commented Feb 5, 2017

Help us to manage our issues by answering the following:

  1. Describe your issue:
    When setting selected attribute for multiple option tags in a select multiple, only the last selected option will be selected.

  2. Can you reproduce the issue?
    http://plnkr.co/edit/jexVSYgXBzr4ATMJqvkP?p=preview
    As you can see, B and C have selected={true}, yet only C is selected.

  3. On which browser/OS does the issue appear?
    All

  4. Which version of Riot does it affect?
    v3.1.1

  5. How would you tag this issue?

  • Question
  • Bug
  • Discussion
  • Feature request
  • Tip
  • Enhancement
  • Performance
@fabien

This comment has been minimized.

Show comment
Hide comment
@fabien

fabien Feb 5, 2017

Contributor

I believe this has been reported (and fixed?) before - if not, I recall having this issue in the past as well. Side-stepped it using DOM-specific methods in the end.

Contributor

fabien commented Feb 5, 2017

I believe this has been reported (and fixed?) before - if not, I recall having this issue in the past as well. Side-stepped it using DOM-specific methods in the end.

@dalyr95

This comment has been minimized.

Show comment
Hide comment
@dalyr95

dalyr95 Feb 16, 2017

Still seeing this issue in 3.2.0 and 3.2.1

<select onchange={sortUpdate}> <option each={ opts.sort } value="{ value }" selected={ true } >{ title }</option> </select>

which results in the following HTML
<select><option value="price_high" __selected="true">Highest Price</option><option value="price_low" __selected="true">Lowest Price</option></select>

dalyr95 commented Feb 16, 2017

Still seeing this issue in 3.2.0 and 3.2.1

<select onchange={sortUpdate}> <option each={ opts.sort } value="{ value }" selected={ true } >{ title }</option> </select>

which results in the following HTML
<select><option value="price_high" __selected="true">Highest Price</option><option value="price_low" __selected="true">Lowest Price</option></select>

@GianlucaGuarini

This comment has been minimized.

Show comment
Hide comment
@GianlucaGuarini

GianlucaGuarini Feb 17, 2017

Member

@dalyr95 you are using an old version of the riot-compiler, the new riot compiler does not produce underscored attributes anymore

Member

GianlucaGuarini commented Feb 17, 2017

@dalyr95 you are using an old version of the riot-compiler, the new riot compiler does not produce underscored attributes anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment