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

Miss behavior when attribute is "newT" #15

Closed
benzen opened this issue Jan 16, 2018 · 5 comments
Closed

Miss behavior when attribute is "newT" #15

benzen opened this issue Jan 16, 2018 · 5 comments

Comments

@benzen
Copy link
Contributor

benzen commented Jan 16, 2018

Here is an exemple

<template data-tagname="my-app">
    <todo-input newT="{{newT}}"></todo-input>
</template>

<template data-tagname="todo-input">
    <input type="text" value="{{newT}}"/>
</template>
{
    "newT":"alpha"
}
@benzen
Copy link
Contributor Author

benzen commented Jan 16, 2018

When the property is "newT", the input don't get any value.
When i change the property name every where for "new", the input get it's value as expected.

@caolan
Copy link
Owner

caolan commented Jan 17, 2018

Attribute names are automatically converted to lowercase by the browser: https://html.spec.whatwg.org/multipage/dom.html#custom-data-attribute

That means {{ newt }} would work but {{ newT }} would not.

It's a bit of an inconvenient restriction in our case, but I don't see much we can do about it.

@caolan
Copy link
Owner

caolan commented Jan 17, 2018

If there is some way we can detect it, it would be nice to give a compile-time warning / error.

@benzen
Copy link
Contributor Author

benzen commented Jan 17, 2018 via email

@benzen
Copy link
Contributor Author

benzen commented Jan 19, 2018

we now have a test case in the suite for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants