Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ function extend(base, props) {

function setClass(attributes, value, append) {
let cl = getClass(attributes);
if (attributes.className) delete attributes.className;
if (append) value = cl ? (cl + ' ' + value) : value;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this will mess up rendering. Likely will render class twice (since its aliased)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my tests, here's what happens (post-patch):

If only className is set, works as intended (class rendered once, correctly).
If only class is set, works as intended (class rendered once, correctly)
If both class and className are set, class is ignored and className is rendered correctly (as the class attribute).

Copy link
Owner

@developit developit Feb 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just wondering if it overwrites preact-mdl's class modifications. I can set up a test if needed, could just be this test but with added class and className variants to verify that the MDL button classes still make it out to the DOM:
https://github.com/developit/preact-mdl/blob/master/test/index.js#L27

attributes.class = value;
}
Expand Down