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

regression: serializing class={{ }} objects for SVG tags #334

Merged
merged 1 commit into from
Sep 29, 2016

Conversation

robbiewxyz
Copy link
Contributor

e7c6ab6 broke serializing class={{ }} for SVG elements. This fixes
that regression and does a little cleans up the logic a little bit.

I've also added a test verifying the proper behavior for SVG.

e7c6ab6 broke serializing `class={{}}` for SVG elements.  This fixes
that regression and does a little cleans up the logic a little bit.

I've also added a test verifying the proper behavior for SVG.
@developit
Copy link
Member

I believe there is already a commit on master for this: 2de530b
I might keep that commit but merge the test - is that alright? The fix on master accounts for className being an object.

@robbiewxyz
Copy link
Contributor Author

The test currently fails on master because hashToClassName() is only run if isSvg == false (See dom/index lines 34-36).

So <circle class="red"/> works, but <circle class={{ red: true }}/> fails. This commit makes both notations work with HTML or SVG elements.

@developit
Copy link
Member

oooh dang, good catch.

@developit developit merged commit 2dfa01e into preactjs:master Sep 29, 2016
@robbiewxyz robbiewxyz deleted the fix-svg-class-hash branch September 29, 2016 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants