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

P-dropdown: tab key does not focus on next item #13916

Closed
ivanatikvic1994 opened this issue Oct 18, 2023 · 5 comments
Closed

P-dropdown: tab key does not focus on next item #13916

ivanatikvic1994 opened this issue Oct 18, 2023 · 5 comments
Labels
Resolution: Stale Issue or pull request is inactivity and unfortunately it will be *closed* if there is no response Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@ivanatikvic1994
Copy link

Describe the bug

When using p-dropdown in form I am not able to use tab key to navigate, once the focus is on dropdown, tab key is not doing anything and the focus remains on dropdown. Issue can be tested in official documentation too. Using tab does not focus away from dropdown, it remains kind of stuck. This is also an accessibility issue. Please let me know if there is something I missed out, was looking a lot to solve the problem, it is current blocker from accessibility point of view. Thank you.

Environment

{{ Timezone }}

Reproducer

No response

Angular version

16.2.6

PrimeNG version

16.3.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.16.0

Browser(s)

Chrome

Steps to reproduce the behavior

https://primeng.org/dropdown
use tab to navigate.

Expected behavior

expected to move focus to next element

@ivanatikvic1994 ivanatikvic1994 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Oct 18, 2023
@SimonJ-DR
Copy link
Contributor

SimonJ-DR commented Oct 18, 2023

Tab is meant to traverse elements. Elements themselves use different keys.
For a dropdown, use space to open and arrow keys to traverse the elements.

https://primeng.org/dropdown#accessibility for more details

@bmayen
Copy link

bmayen commented Oct 24, 2023

#13944 related. While I can tab to a dropdown then use space to access it, I cannot tab away from it. Keyboard focus gets trapped once it hits a dropdown

@w3soto
Copy link

w3soto commented Oct 27, 2023

Quick fix

import { Dropdown } from 'primeng/dropdown';

const origOnKeydown = Dropdown.prototype.onKeydown;
Dropdown.prototype.onKeydown = function (event: KeyboardEvent, search: boolean) {
  if (event.which == 9) {
    this.hide();
    return;
  }
  origOnKeydown.apply(this, [event, search]);
};

Copy link

This issue has been automatically marked as stale due to a lack of activity. If this issue is still relevant to you, please leave a comment so we can keep it open. We apologize for not being able to prioritize it sooner. If you have any new information or questions, please share them in your comment!

@github-actions github-actions bot added the Resolution: Stale Issue or pull request is inactivity and unfortunately it will be *closed* if there is no response label Dec 16, 2024
@mertsincan
Copy link
Member

Hi,

So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation and try the latest PrimeNG version(v19). If there is no improvement on this, can you open a new issue so we can include it in our roadmap?

Thanks a lot for your understanding!
Best Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Stale Issue or pull request is inactivity and unfortunately it will be *closed* if there is no response Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

5 participants