Skip to content
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

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
Labels

Comments

@alexssung
Copy link

@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
Copy link
Contributor

@fabien 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
Copy link

@dalyr95 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
Copy link
Member

@GianlucaGuarini 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.