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

Dropdown component is triggering onChange when tabbing over #5942

Closed
dancras opened this issue Feb 12, 2024 · 2 comments · Fixed by #5952
Closed

Dropdown component is triggering onChange when tabbing over #5942

dancras opened this issue Feb 12, 2024 · 2 comments · Fixed by #5952
Assignees
Labels
Component: Accessibility Issue or pull request is related to WCAG or ARIA
Milestone

Comments

@dancras
Copy link

dancras commented Feb 12, 2024

Describe the bug

Version 10.5.0 has introduced an unexpected behaviour that tabbing over a dropdown component triggers an onChange event

Reproducer

https://codesandbox.io/p/sandbox/primereact-test-forked-6qvhkq

PrimeReact version

10.5.0

React version

18.x

Language

ALL

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

  • Load the sandbox
  • Repeatedly press "tab" to focus and unfocus the dropdown
  • See that rows are added to the display, as part of the onChange event handler

Expected behavior

onChange should only trigger when a selection is made

@dancras dancras added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 12, 2024
@RolT
Copy link

RolT commented Feb 13, 2024

On top of that, tab should jump to the next input if the dropdown is not open, but we stay in the dropdown. 10.4.0 works properly.

I assume the new behaviour is a side effect of the "Input accessibility" changes - (is the linked issue private ? #5991)

@melloware
Copy link
Member

Yes it is related to the accessibility. It seems PrimeVue behaves correctly: https://primevue.org/dropdown/

So maybe we need to look and port their fixes?

@melloware melloware added Component: Accessibility Issue or pull request is related to WCAG or ARIA and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Feb 13, 2024
melloware added a commit to melloware/primereact that referenced this issue Feb 13, 2024
melloware added a commit to melloware/primereact that referenced this issue Feb 13, 2024
@melloware melloware self-assigned this Feb 13, 2024
@melloware melloware added this to the 10.5.1 milestone Feb 13, 2024
melloware added a commit to melloware/primereact that referenced this issue Feb 13, 2024
melloware added a commit that referenced this issue Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Accessibility Issue or pull request is related to WCAG or ARIA
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants