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

Ember.View.reopen() from guide for binding data-* attributes doesn't work since I updated ember to 1.13.x #11849

Closed
imaxhung opened this issue Jul 21, 2015 · 7 comments
Labels

Comments

@imaxhung
Copy link

I just put that code form guide in application route before the upgrade, then start to use data-* attributes. Like:

{{input data-parsley-required="true" data-...}}

It works fine.

But it doesn't work after the upgrade.

Now, I must put those data-* attributes into Ember.TextField.reopen()'s attributeBindings one by one.
Did I missing something?

@rwjblue
Copy link
Member

rwjblue commented Jul 21, 2015

Which specific version of Ember?

@imaxhung
Copy link
Author

ember 1.13.3
ember-cli 1.13.1
@rwjblue You can test it in a new app.
Or do I put that code into a wrong place?

@stefanpenner
Copy link
Member

@imaxhung it may be helpful if you are able to post a http://emberjs.jsbin.com demonstrating the issue.

@imaxhung
Copy link
Author

@stefanpenner
Ok, http://emberjs.jsbin.com/katefuwiju/edit?html,js,output
Check input field, its dom element should contain data-* attribute.But it doesn't. That's what I say
And change ember to 1.12.0
http://emberjs.jsbin.com/diduholame/edit?html,js,output
It works find.

I found Ember.keys(this) don't contain those additional attributes from templates since 1.13.0.

@rwjblue
Copy link
Member

rwjblue commented Jul 22, 2015

The reason for this, is that we export a deprecated version of Ember.View to provide a "nice" warning message when you use it. That deprecated version is placed at Ember.View, and is what your example is reopening. Unfortunately, we use an internal non-deprecated version as the parent class for all other components and views used internally. This is why Ember.View.reopen does not update/change the attributeBindings as you might expect.


To fix this, we would need to override Ember.View.reopen (on the deprecated class that is currently exported as Ember.View) somewhere around here. This custom reopen would then call reopen on the main parent class as it did before.

@rwjblue rwjblue added the Bug label Jul 22, 2015
@ghost
Copy link

ghost commented Jul 23, 2015

I think I can fix this.
We should probably do the same for ContainerView, Select, etc..

@mixonic
Copy link
Member

mixonic commented Jul 23, 2015

The issue seems be that components inherit from views in 1.13. We can support the fix in #11866 for 1.13, but the same code will break in 2.0 for sure. We should call it out in the release post (started notes here).

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

4 participants