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

attributeBinding with properties not available in element prototype do not get set. #10202

Closed
rwjblue opened this issue Jan 12, 2015 · 11 comments
Labels

Comments

@rwjblue
Copy link
Member

rwjblue commented Jan 12, 2015

We do a attrName in element check to see if a property exists for a given attribute, and if it does we set it as a prop, but if not we use setAttribute. In the case of novalidate on <form> elements, it is not a property, so we fallback to setAttribute (which leads to it not being added to the DOM).

screenshot

Demo: http://emberjs.jsbin.com/rwjblue/203/edit

@rwjblue
Copy link
Member Author

rwjblue commented Jan 12, 2015

@mixonic - Can you confirm my summary (I may have the prop/attr thing backwards)?

@wagenet
Copy link
Member

wagenet commented Jan 12, 2015

By the way, it looks like noValidate (camelcased) is a property. So document.createElement('form').noValidate = true does what is expected. If I camel-case the property then it looks like it works: http://emberjs.jsbin.com/yadawejase/1/edit.

@mixonic
Copy link
Member

mixonic commented Jan 12, 2015

@wagenet there is normalization code that should have caught that. I believe the issue would be in setProperty. There are tests around it elsewhere (using maxLength as an example), but perhaps you have unearth a bug in the caching code or something.

wagenet added a commit to wagenet/ember.js that referenced this issue Jan 12, 2015
@wagenet
Copy link
Member

wagenet commented Jan 13, 2015

It turns out this is not a new regression. It last worked in 1.7 where it rendered <form novalidate='novalidate'>.

@wagenet
Copy link
Member

wagenet commented Jan 13, 2015

@kiwiupover
Copy link
Contributor

I was seeing the same issue in #10183

Is there anything I can do to help?

@rwjblue
Copy link
Member Author

rwjblue commented Jan 13, 2015

There is no normalization for attributeBindings (in 1.9, 1.10, or canary at this point). The good news is that #10186 should fix this (since it would then go through the normalization that happens in AttrNodes), but sadly I do not think that it will make it to beta (it is a pretty big change to make so late in the beta cycle).

@rwjblue
Copy link
Member Author

rwjblue commented Jan 13, 2015

@kiwiupover - Off the top of my head I do not believe #10183 is related to this, but I'll try to dig around to confirm/deny.

@kiwiupover
Copy link
Contributor

@rwjblue thanks. Thanks heaps for all you are doing.

@mmun
Copy link
Member

mmun commented Jul 8, 2015

Looks like this is working now: http://emberjs.jsbin.com/xuyubejida/edit?html,js,output
Can you confirm @rwjblue ?

@stefanpenner
Copy link
Member

this behavior is now exactly what we want (and exactly the opposite of what it was.)

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

No branches or pull requests

6 participants