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

Calendar | Unexpected focus happens in disabled mode #12282

Closed
livanova-incomm opened this issue Nov 24, 2022 · 0 comments · Fixed by #12300
Closed

Calendar | Unexpected focus happens in disabled mode #12282

livanova-incomm opened this issue Nov 24, 2022 · 0 comments · Fixed by #12300
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@livanova-incomm
Copy link

livanova-incomm commented Nov 24, 2022

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:

  • There is a long page with scroll and with inline calendar at the bottom.
  • There is code behavior which could update calendar model implicitly (without user clicking on the calendar).

Steps to reproduce:

  • Load the page and trigger that code behavior to update calendar model.
  • Observe unwanted and unexpected page jumping to the updated calendar.

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.

@livanova-incomm livanova-incomm added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 24, 2022
@cetincakiroglu cetincakiroglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Nov 29, 2022
@cetincakiroglu cetincakiroglu self-assigned this Nov 29, 2022
@cetincakiroglu cetincakiroglu added this to the 15.0.0 milestone Nov 29, 2022
@cetincakiroglu cetincakiroglu changed the title Component: Calendar Calendar | Unexpected focus happens in disabled mode Nov 29, 2022
cetincakiroglu added a commit that referenced this issue Nov 29, 2022
Fixed #12282 - Calendar | Unexpected focus happens in disabled mode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants