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
Reselect element with focus when datepicker closes #3317
Comments
At the moment the focus is lost, so it will be restored to the previously focused element (before datepicker was opened) Fixes ng-bootstrap#3317 Fixes ng-bootstrap#3358
At the moment the focus is lost, so it will be restored to the previously focused element (before datepicker was opened) Fixes ng-bootstrap#3317 Fixes ng-bootstrap#3358
At the moment the focus is lost, so it will be restored to the previously focused element (before datepicker was opened) Fixes #3317
Hi. This change breaks the usage of opening the datepicker via
When the datepicker is dismissed by clicking somewhere else, the input gets focussed again and reopens the datepicker, therefore it will never close again. @maxokorokov unless there is another way of opening the datepicker on focus, this seems to be a bug for me |
We also stumbled across this bug |
Thinking about this more I think this functionality should either be explicitly enabled: <input ngbDatepicker [refocus]="true" /> Or focus should be manually set by the user: <input ngbDatepicker (closed)="otherElement.focus()" /> There doesn't seem to be any way for this to play nicely with
|
This is request for change.
When:
previously select element should be probably reselected, as it's done for modal with element to focus:
https://github.com/ng-bootstrap/ng-bootstrap/blob/master/src/modal/modal-window.ts#L68
This would allow users to quickly reselect value in the case of e.g. minor error that could be quickly corrected
.
Other reference implementation supporting this behaviour:
https://material.angular.io/components/datepicker/overview
https://clarity.design/documentation/datepicker#examples
This would be non breaking change (unless some tests rely on keyboard navigation with presumed current focus behaviour).
Thanks!
NgBootstrap: 5.1
The text was updated successfully, but these errors were encountered: