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: trigger remove chip event when the chip is visible #7193

Merged
merged 3 commits into from
Oct 11, 2024

Conversation

KumJungMin
Copy link
Contributor

@KumJungMin KumJungMin commented Sep 16, 2024

Defect Fixes


how to resolve

Why the issue occured?

  • Even when overflow: hidden and text-overflow: ellipsis are applied, overflowed elements are still rendered.
  • As a result, a click event on the delete button of a hidden element can still trigger the delete action.

The image below shows that the hidden elements are still rendered.
스크린샷 2024-09-16 오후 9 29 47


solution

  • To resolve this issue, I added isVisible function to check chip is visible.
  • The isVisible function checks whether a chip element is hidden within its parent container due to overflow: hidden and text-overflow: ellipsis.
  • This prevents the delete event from being triggered if the chip element is hidden.
  • The function checks for overflow and calculates if the element's boundaries are within the visible area of the parent. :)
    (plus: If labelRef's position is relative, the calculation will be simpler.)

result

2024-09-17.12.49.21.mp4

Copy link

vercel bot commented Sep 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
primereact ⬜️ Ignored (Inspect) Visit Preview Sep 16, 2024 3:56pm
primereact-v9 ⬜️ Ignored (Inspect) Visit Preview Sep 16, 2024 3:56pm

@KumJungMin KumJungMin marked this pull request as ready for review September 16, 2024 15:53
@melloware melloware added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Sep 16, 2024
@melloware melloware requested review from mertsincan and removed request for nitrogenous September 24, 2024 12:16
@melloware melloware merged commit fb03057 into primefaces:master Oct 11, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Pending Review Issue or pull request is being reviewed by Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiselect: Сhip options can be closed outside of overflow
4 participants