-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[BUG beta] attributeBindings not working for "role" #14007
Comments
Ok, I've bisected this to this PR: #13887 /cc @krisselden My failing test is this one: diff --git a/packages/ember-glimmer/tests/integration/components/attribute-bindings-test.js b/packages/ember-glimmer/tests/integration/components/attribute-bindings-test.js
index 072284b..0fe13f7 100644
--- a/packages/ember-glimmer/tests/integration/components/attribute-bindings-test.js
+++ b/packages/ember-glimmer/tests/integration/components/attribute-bindings-test.js
@@ -517,4 +517,17 @@ moduleFor('Attribute bindings integration', class extends RenderingTest {
this.assertComponentElement(this.firstChild, { tagName: 'a', attrs: { href: 'unsafe:javascript:alert(\'foo\')' } });
}
+
+ ['@test it can bind the role attribute (issue #14007)']() {
+ let FooBarComponent = Component.extend({
+ role: 'button',
+ attributeBindings: ['role']
+ });
+
+ this.registerComponent('foo-bar', { ComponentClass: FooBarComponent, template: 'hello' });
+
+ this.render('{{foo-bar}}');
+
+ this.assertComponentElement(this.firstChild, { tagName: 'div', attrs: { role: 'button' } });
+ }
}); Enough for today. 😴 |
I believe that https://github.com/emberjs/ember.js/pull/13887/files#diff-1654f1d069eb2138afd01d960e2a78a7R187 is clobbering the user specified attributeBinding for 'role'. We should add this as the default before the loop over attributeBindings. |
Should be easy to fix, I'll try to get to it soonish, a failing test PR would be nice, just need to check role before defaulting it |
@krisselden Yep, that was enough #14009 |
This works in 2.7 and fails in 2.8. Funny enough, it seems to work in general, it just fails (that I've know of) with the
role
attribute.Twiddle with a demo: https://ember-twiddle.com/ba0c926a18c53ee7155dc23059c70caa?openFiles=components.my-component.js%2Ctemplates.components.my-component.hbs
The text was updated successfully, but these errors were encountered: