This repository was archived by the owner on Jun 28, 2026. It is now read-only.
fix(button): make icon inside Button clickable in OrderList itemTemplate (#8145)#8146
Closed
karan74jaiswal wants to merge 2 commits into
Closed
Conversation
…ate (primefaces#8145) - Set pointer-events: none on .p-button-icon so clicks on the icon bubble to the button - Fixes primefaces#8145
Member
|
@karan74jaiswal can you review and test my PR please? #8147 It fixes it without adding a custom style on the component. |
Author
|
@melloware I am also a contributer not a core team member. Both approaches do the same things. I do not have right to test your pr. |
Member
|
you can just remove your change and make the same change as mine in your local branch and test it. Its a small change |
Author
|
@melloware I tested your approach. Its doing the right thing. I tried to reproduce the issue, and got that bug is fixed. |
Member
|
Thanks for testing! |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #8145
Root Cause:
When using a Button inside an OrderList itemTemplate, only the area outside the icon was clickable. This was because the icon element inside the Button was intercepting pointer events, so clicks on the icon did not bubble up to the button element.
Solution:
I set
pointer-events: noneon the icon element (.p-button-icon) inside the Button component. This ensures that all clicks on the icon are passed through to the button, making the entire button (including the icon) clickable.Change Details:
style: { pointerEvents: 'none' }to the icon props in the Button component.This change makes the Button's
onClickhandler fire regardless of where the user clicks inside the button, including directly on the icon.