-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
AutoFocus for Dropdown: Does not work inside dialogComponent. #14010
Comments
The autofocus is a Boolean attribute indicating that an element should be focused on page load. That's why it doesn't work with dialog. It's not a bug, you can find a workaround by timeout and focus manually on the dropdown when the dialog opens. Closing the issue since it's not a bug or defect. |
Hi, I tried all the ways including timeout and set the focus manually. It is not working. As I explained before - autofocus is working fine for textbox inside p-dialog. Here is the stackblitz url: https://stackblitz.com/edit/primeng-dialog-demo-14g5tl?file=src%2Fapp%2Fapp.component.html Thanks in advance. |
Also doesn't work for us, it does work if you put in a random input with autofocus. |
Describe the bug
If AutoFocus is used for Dropdown inside a dialog, focus is not applied to the element.
For Text Box AutoFocus is working fine.
If Dropdown is not in dialog - AutoFocus is working fine.
Environment
Any Environment.
Reproducer
No response
Angular version
16.2.11
PrimeNG version
16.7.0
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
14.9.3
Browser(s)
Chrome 90
Steps to reproduce the behavior
Expected behavior
Focus should be on p-dropdown
The text was updated successfully, but these errors were encountered: