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

data-is works differently as expression to hard-coded attribute #2321

Closed
davidhewitt opened this Issue Apr 18, 2017 · 0 comments

Comments

Projects
None yet
2 participants
@davidhewitt

Help us to manage our issues by answering the following:

  1. Describe your issue:

Hi there,

I'm using data-is to display conditionally some views where, for some of them, I have implemented a custom tag.

This is like an image gallery - so the data-is fields are dynamically filled to "my-apple", "my-orange", "my-banana" etc. For some of these, e.g. "my-apple", I have defined a custom tag which does something unique. For my-orange and my-banana, which aren't real tags, I just want riot to ignore the data-is attribute.

It turns out this almost works. This works:

<div data-is="my-banana">
   My default markup
</div>

But this doesn't (note I'm using { } to set data-is this time):

<div data-is={"my-banana"}>
   My default markup
</div>

Instead of seeing "My default markup" in the second case, I just get "undefined". Is this expected behaviour?

Cheers
David

  1. Can you reproduce the issue?
  1. On which browser/OS does the issue appear?
    Testing on Chrome

  2. Which version of Riot does it affect?
    Latest version (3.4.2)

  3. How would you tag this issue?

  • Question
  • Bug
  • Discussion
  • Feature request
  • Tip
  • Enhancement
  • Performance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment