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

Ternary if does not behave as expected #2454

Closed
ramonakira opened this issue Sep 30, 2017 · 1 comment
Closed

Ternary if does not behave as expected #2454

ramonakira opened this issue Sep 30, 2017 · 1 comment

Comments

@ramonakira
Copy link

@ramonakira ramonakira commented Sep 30, 2017

  1. Describe your issue:
    When doing a "ternary if" inside a style-attribute, if the condition evaluates to false the second expression is not used when it is '' (empty) but only when it contains a (any) value.

  2. Can you reproduce the issue?
    http://plnkr.co/edit/mNhJOcH1TBmqP7RgqOCQ

  3. On which browser/OS does the issue appear?
    Tested on latest versions of Firefox, Edge and Opera

  4. Which version of Riot does it affect?
    3.7.2

  5. How would you tag this issue?

  • Question
  • Bug
  • Discussion
  • Feature request
  • Tip
  • Enhancement
  • Performance
@marciojc
Copy link
Contributor

@marciojc marciojc commented Sep 30, 2017

This is maybe because the expression is null then there is any alterations.
This example is very easy to fix if you change to changed ? 'background-color: green' : ' '

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
3 participants
You can’t perform that action at this time.