ember-polyfills / ember-angle-bracket-invocation-polyfill

MIT License
76 stars 33 forks source link

Add test for merging of class names by ...attributes #25

Closed jacojoubert closed 5 years ago

jacojoubert commented 6 years ago

This test fails. Expected behaviour is that if you create a component

<button class="button" ...attributes></button>

and invoke it using

<MyButton class="primary"></MyButton>

That the final element created would be

<button class="button primary"></button>

but currently only the primary class gets assigned.

jacojoubert commented 6 years ago

I do not understand how all the pieces interact here because if I install ember-angle-bracket-invocation-polyfill as a devDependency (as opposed to a dependency) it appears to properly merge the classes. I wrote this test after code that used to work stopped working when switching it to a dependency for my addon. Why would this be?

// my-button
<button class="button" ...attributes>
  {{yield}}
</button>
// dummy app
<MyButton class="primary">Button</MyButton>

Output as dependency

image

Output as devDependency

image