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

Fix Ripple error when using svg in Button slot #448

Merged
merged 2 commits into from
Aug 27, 2020
Merged

Fix Ripple error when using svg in Button slot #448

merged 2 commits into from
Aug 27, 2020

Conversation

lochstar
Copy link
Contributor

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.

<Button class="p-button-primary">
  <FontAwesome icon="file-download" class="p-button-icon-left" />
  <span class="p-button-label">Download</span>
</Button>

I've put a check in place to make sure className is in fact a string. For SVG we can use classList to read the classes, but this isn't supported on SVG in IE10 and 11 so it may be safe to just ignore.

@cagataycivici cagataycivici merged commit fb7a0d7 into primefaces:master Aug 27, 2020
@cagataycivici cagataycivici self-assigned this Aug 27, 2020
@cagataycivici cagataycivici added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add labels Aug 27, 2020
@cagataycivici cagataycivici added this to the 2.0.8 milestone Aug 27, 2020
@cagataycivici
Copy link
Member

Thank you'

@lochstar lochstar deleted the button-slot-ripple-fix branch August 27, 2020 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants