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

ListBox: Duplicate "status" role span when using custom emptyMessage #16689

Open
LorenzSLA opened this issue Nov 4, 2024 · 0 comments
Open
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@LorenzSLA
Copy link
Contributor

Describe the bug

When using the PrimeNG ListBox component with a custom emptyMessage, two elements with the role="status" are added to the DOM when the list is empty. The first span contains the custom emptyMessage, and the second span contains the default message ("No selected item"). This results in both messages being "rendered" (not visible), which is incorrect behavior.

Environment

Windows 10, Angular/Primeng as below

Reproducer

https://stackblitz.com/edit/github-6ip3rq

Angular version

18.2.7

PrimeNG version

17.18.11

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.20.3

Browser(s)

Chrome 130

Steps to reproduce the behavior

  1. Integrate the PrimeNG ListBox component into an Angular project.
  2. Set a custom emptyMessage for the ListBox component.
  3. Ensure that the ListBox contains no items.
  4. Open the browser's developer tools and inspect the DOM structure of the ListBox component.
  5. Observe that two elements with role="status" are present.

Expected behavior

Only one with role="status" should be present, containing the custom emptyMessage. The default message should not appear if a custom emptyMessage is provided.

@LorenzSLA LorenzSLA added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 4, 2024
@LorenzSLA LorenzSLA changed the title Component: Title ListBox: Duplicate "status" role span when using custom emptyMessage Nov 4, 2024
pointers-enjoyer added a commit to pointers-enjoyer/primeng-fork that referenced this issue Nov 4, 2024
@mehmetcetin01140 mehmetcetin01140 added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Nov 12, 2024
@mehmetcetin01140 mehmetcetin01140 added this to the 17.18.12 milestone Nov 12, 2024
mehmetcetin01140 added a commit that referenced this issue Nov 12, 2024
fix( #16689): duplicated span in ListBox component
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

No branches or pull requests

2 participants