Skip to content
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
primefaces:masterfrom
karan74jaiswal:fix/button-orderlist-icon-click-8145
Closed

fix(button): make icon inside Button clickable in OrderList itemTemplate (#8145)#8146
karan74jaiswal wants to merge 2 commits into
primefaces:masterfrom
karan74jaiswal:fix/button-orderlist-icon-click-8145

Conversation

@karan74jaiswal

Copy link
Copy Markdown

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: none on 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:

  • Added style: { pointerEvents: 'none' } to the icon props in the Button component.

This change makes the Button's onClick handler fire regardless of where the user clicks inside the button, including directly on the icon.

…ate (primefaces#8145)

- Set pointer-events: none on .p-button-icon so clicks on the icon bubble to the button
- Fixes primefaces#8145
@melloware

Copy link
Copy Markdown
Member

@karan74jaiswal can you review and test my PR please? #8147

It fixes it without adding a custom style on the component.

@melloware melloware marked this pull request as draft July 16, 2025 11:04
@karan74jaiswal karan74jaiswal marked this pull request as ready for review July 16, 2025 11:22
@karan74jaiswal

Copy link
Copy Markdown
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.

@melloware

Copy link
Copy Markdown
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

@karan74jaiswal

Copy link
Copy Markdown
Author

@melloware I tested your approach. Its doing the right thing. I tried to reproduce the issue, and got that bug is fixed.

@melloware

Copy link
Copy Markdown
Member

Thanks for testing!

@melloware melloware closed this Jul 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Button: When using a Button inside of a OrderList itemTemplate component, only outside of icon is clickable

2 participants