Skip to content

style attribute with expressions makes show directive invalid at the beginning #2178

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

Closed
1 of 7 tasks
Joylei opened this issue Dec 25, 2016 · 4 comments
Closed
1 of 7 tasks

Comments

@Joylei
Copy link
Contributor

Joylei commented Dec 25, 2016

Help us to manage our issues by answering the following:

  1. Describe your issue:

if there are expressions in style attribute, the show directive would not work at the beginning

    <child>
      <button onclick="{ toggle }">toggle</button>
      <p show="{ selected }" style="height:{ height };">should be hidden when inited</p>
      
      this.selected = false
      this.height = 'auto'
      this.toggle = ()=>{
        this.selected = !this.selected
      }
    </child>
  1. Can you reproduce the issue?

http://jsbin.com/yokegejoca/edit?html,output

  1. On which browser/OS does the issue appear?
    macOS 10.12.2; Chrome 55
  2. Which version of Riot does it affect?
    3.0.5
  3. How would you tag this issue?
  • Question
  • Bug
  • Discussion
  • Feature request
  • Tip
  • Enhancement
  • Performance
@rsbondi rsbondi added the bug label Dec 25, 2016
@GianlucaGuarini
Copy link
Member

I think it's related to #2158

@rsbondi
Copy link
Contributor

rsbondi commented Jan 9, 2017

I believe style=whatever is overriding the display: none set by show, maybe if this was handled in update it would solve both issues

@Joylei
Copy link
Contributor Author

Joylei commented Jan 11, 2017

@rsbondi
agree.

@rsbondi
Copy link
Contributor

rsbondi commented Jan 20, 2017

#2178

GianlucaGuarini added a commit that referenced this issue Mar 26, 2017
GianlucaGuarini added a commit that referenced this issue Mar 26, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
* master:
  updated: fixed wrong text in the readme file
  updated: libraries sizes
  3.4.0
  added: support for style and class object attributes
  closes #2178
  updated: simplified the special expressions updates
  updated: cleaning up the update method
  updated: dbmon frames rendering strategy
  closes #2080
  closes #2103
  fixed: make sure that the riot version gets exported as string
  updated: dev dependencies
  Enable syntax highlighting of tag files
  updated: small optimization avoiding the shouldUpdate check for the anonymous tags
  updated: dev dependencies
  Delete a duplicate line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants