Fix Ripple error when using svg in Button slot #448
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When using an SVG in a Button slot, Ripple encounters an error:
Error in directive ripple unbind hook: "TypeError: el.children[i].className.indexOf is not a function
This is a new bug from the introduction of Button slot #388.
The issue occurs when Ripple is trying to read the
className
of an SVG, which isn't a string.Example below using a custom
FontAwesome
component that renders an SVG.I've put a check in place to make sure
className
is in fact a string. For SVG we can useclassList
to read the classes, but this isn't supported on SVG in IE10 and 11 so it may be safe to just ignore.