primereact
primereact copied to clipboard
Dropdown: lost focus when select item using keyboard [also lost focus when remove selected item using keyboard]
Describe the bug
When select dropdown's item using mouse, the focus is restored on dropdown component. But when select item using keyboard, the focus is lost. Also when move focus to X button of selected item and hit enter, dropdown lost focus.
Reproducer
No response
PrimeReact version
10.7.0
React version
17.x
Language
TypeScript
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
-
go to Dropdown showcase: https://primereact.org/dropdown/#filter
-
open dropdown item list
-
set focus on filter input (in our case, dropdown has autoFocus props set)
-
use keyboard arrow up/down to pre-select and item
-
hit Enter keyboard key => item is selected but dropdown component is not focused.
-
restore focus on dropdown component with selected country item
-
hit tab to move focus on X cross button
-
hit enter => the item is removed from dropdown (good) but focus is not restored on dropdown component.
Expected behavior
per accessibility rules, dropdown component should be focused after item selection or after remove selected item
Similar to https://github.com/primefaces/primereact/issues/6803
Siimilar to: https://github.com/primefaces/primereact/issues/6269
This issue has been automatically marked as stale. If this issue is still affecting you with the latest version, please leave any comment, and we will keep it open. We are sorry that we have not been able to prioritize it yet. If you have any new additional information, please include it with your comment!
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you for your understanding!