Calendar | Unexpected focus happens in disabled mode #12282
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
Describe the bug
Calendar (inline) implicitly sets focus on top right cell (date) in calendar. It may lead to unwanted page jumping.
Use case:
I have an inline calendar which is displayed at the bottom of my page and isn't visible because of the page length. I make some changes that cause the calendar to update indirectly. Once the calendar is updated, the page jumps to the calendar since focus is set to top right cell in the calendar.
Note: There wasn't such unwanted behavior in version 12.0.1
Such behavior could be considered as works as expected. However in such case there is a necessity to have an option to disable unwanted focus (especially since it is an inline calendar).
Expected behavior:
No unexpected focus is set to inline calendar which has been updated.
Alternate solution/behavior:
There is a new property which could be used to disable autofocus in inline calendars.
Environment
Window 10
Google Chrome 107.0.5304.107
Angular 14.0.4
PrimeNG 14.0.2
Reproducer
https://stackblitz.com/edit/github-33cody?file=src/app/app.component.html
Angular version
14.0.4
PrimeNG version
14.2.2
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
16.14.2
Browser(s)
Google Chrome 107.0.5304.107
Steps to reproduce the behavior
Pre-conditions:
Steps to reproduce:
See a demo I prepared: https://stackblitz.com/edit/github-33cody?file=src/app/app.component.html
One more example (where the page is automatically jumps to the end): https://stackblitz.com/edit/github-epxzyj?file=src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.component.css,src%2Fapp%2Fapp.component.ts
Expected behavior
No unexpected focus is set to inline calendar which has been updated.
OR:
There is a new property which could be used to disable autofocus in calendars.
The text was updated successfully, but these errors were encountered: