fix(splitbutton): add icon and item templates for custom icons - #19595
Open
leonidasdel wants to merge 3 commits into
Open
fix(splitbutton): add icon and item templates for custom icons#19595leonidasdel wants to merge 3 commits into
leonidasdel wants to merge 3 commits into
Conversation
Forward #item to the overlay TieredMenu and support #icon on the default action button when icon is unset, matching other PrimeNG components. Update the icons showcase with inline SVG examples. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
TieredMenu only accepts #item via content projection, not an input binding. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
|
@mehmetcetin01140 could you please check it? According to docs we can safely add our own custom icons but it seems here it was not supported and it is blocking our migration |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
SplitButton now supports custom icons from any library (inline SVG, Font Awesome, Material Icons, images, etc.) via templates, consistent with other PrimeNG components and the custom icons documentation.
#icon— custom icon for the default action button when theiconproperty is not set#dropdownicon— already supported; omitdropdownIconwhen using the template#item— custom menu item template forwarded to the overlay TieredMenuChanges
packages/primeng/src/splitbutton/splitbutton.ts— icon template on default button; item template projected intop-tieredmenupackages/primeng/src/types/splitbutton/splitbutton.types.ts—SplitButtonTemplatesupdatedpackages/primeng/src/splitbutton/splitbutton.spec.ts— unit tests for new templatesapps/showcase/doc/splitbutton/icons-doc.ts— showcase examples for class-based and template-based iconsTest plan
ng test primeng --include=src/splitbutton/splitbutton.spec.ts— 91/91 passingMade with Cursor