-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Ripple doesn't support FontAwesome SVG Kit for Button/Menu/etc #9853
Comments
We have the menubar - control in our app and this error appears only when the current route is a nested route. Coming from any other route, the same menu item - routing works as expected. I am not sure if this error is causing it but the navigation breaks when I see this error in the console. |
Okay I found it... we used one font-awesome icon inside of a MenuItem - definition for a menubar for primeng. This breaks the whole navigation, I was searching for hours... @TheWrightDev thx for your description, probably saved me days... |
Found this issue today while trying to use an SVG icon inside a pRipple. Wrapping the SVG with an unnecessary div fixes the issue. |
Hi, So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you reopen the issue so we can include it in our roadmap? Best Regards, |
I'm submitting a ... (check one with "x")
Current behavior
If using a FontAwesome Pro SVG kit, the
getInk()
method explodes when attempting to search for thep-ink
class.primeng/src/app/components/ripple/ripple.ts
Line 55 in c972065
The SVG kit replaces the HTML element with the class names with a new svg element. And since the
className
property on an SVG element has a different definition from theclassName
property of an HTML element, it pops when trying to find the class. So it can't just blindly be jumping on indexOf.Expected behavior
Would not break app.
Could easily be fixed by checking if indexOf is a function before hand on the same line: (
this.el.nativeElement.children[i].className.indexOf && ...
), or could even look for an svg explicitly (!(this.el.nativeElement.children[i] instanceof SVGElement) && ...
), or however you would care to stop it.Minimal reproduction of the problem with instructions
If you don't want to mess around with font awesome, just swap the icon span with an svg on a ripple supported component like a button or a menu item. Otherwise, add a FontAwesome Pro kit using SVGs, add an icon to a button or menu item and watch the show.
What is the motivation / use case for changing the behavior?
So that ripple can be used while using one of the largest Font libraries out there.
Please tell us about your environment:
Angular version: 11.1.0
PrimeNG version: 11.2.0
Browser: all
Language: all
The text was updated successfully, but these errors were encountered: