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

Comments

Projects
None yet
3 participants
@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

This comment has been minimized.

Show comment
Hide comment
@marciojc

marciojc Sep 30, 2017

Contributor

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' : ' '

Contributor

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