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

Attribute binding only works with all lowercase binding names #72

Open
cpdog opened this issue Mar 20, 2021 · 2 comments
Open

Attribute binding only works with all lowercase binding names #72

cpdog opened this issue Mar 20, 2021 · 2 comments

Comments

@cpdog
Copy link

cpdog commented Mar 20, 2021

I'm not entirely sure why this line is here

var attrName = attr.name.toLowerCase();

but it means that any bindings that have names like this: someBinding won't work. A couple built in bindings happen to work, such as textInput, because they are actually aliased to have lower case versions as well. Obviously, a work around is to simply alias any binding that doesn't already have a lower case alias, but I'm not certain why that's necessary. Was this intentional?

@mbest
Copy link
Owner

mbest commented Mar 21, 2021

Actually, the browser is supposed to lowercase the attributes. So this code just doubly ensures they are lowercase. The general method of converting camel-cased JavaScript to attributes is to add hyphens. Thus someBinding would become some-binding.

@cpdog
Copy link
Author

cpdog commented Mar 22, 2021

Thus someBinding would become some-binding.

Agreed, that would be the best solution. Right now however, that doesn't work. Would it be reasonable to simply change kebab case to camel case where the lower case version isn't found? e.g., check for a binding named some-binding like it already does, if that fails, check for a binding named someBinding.

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