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

Conditional `if` does not work as expected with select tag and dynamic options #2229

Infeligo opened this issue Jan 20, 2017 · 2 comments


Copy link

@Infeligo Infeligo commented Jan 20, 2017

Help us to manage our issues by answering the following:

  1. Describe your issue:

I wanted to used if attribute on select tag with dynamic options like this:

  <select if={ showSelect }>
    <option each={ list } value={ value }>{ text }</option>

However, when if expression value toggles, unexpected artifacts in form of empty selects are left in the DOM.

  1. Can you reproduce the issue?
(click "Toggle" button multiple times to reproduce this issue)

  1. On which browser/OS does the issue appear?

Chrome 55 and Firefox 49 on Windows 8.1

  1. Which version of Riot does it affect?

At least Riot 3.0.7

  1. How would you tag this issue?
  • Question
  • Bug
  • Discussion
  • Feature request
  • Tip
  • Enhancement
  • Performance
Copy link

@rbatistajs rbatistajs commented Jan 20, 2017

I made a test by removing the "else" from that line

Getting +/- like this

if (this.current._tag)

if (this.current.parentNode)

I did the test and it worked, just don't know if it's the correct solution.

(Sorry for my bad english)

Copy link

@GianlucaGuarini GianlucaGuarini commented Jan 21, 2017

thank you @rbatistajs I will work on a patch soon

GianlucaGuarini added a commit that referenced this issue Jan 28, 2017
GianlucaGuarini added a commit that referenced this issue Jan 28, 2017
* bug/2229:
  closes #2229
  added: test for #2229
@fabien fabien mentioned this issue Feb 5, 2017
1 of 7 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

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