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
DatePicker set focus to input control after a user selecting date on date-picker's calenadar #1934
Comments
@topguss any particular guidelines / recommendations that would justify this behaviour? I just tested a couple of datepickers on well-known sites and I can't see this behaviour being implemented systematically. Please provide any additional info that would help us decide if this is the right behaviour to implement. |
BTW, the title of this issue says "DateTimePicker" but we don't have date-time picker widget here. I assume you've meant date-picker? |
Yes, you are right, I mean about date-picker. When you working on enterprise application, you need to provide good user experience, so that user can easy move through form's controls. There is problem if focus become lost. You can not select next control easy, especially if user request Features "next control on enter (enter key press)". In the data-pickers base on jquery, developers were subscribe on some event and handle it. The second reason we need this functionality is absent of support for Date type in a model. So, to handle this, we need to have pipe to transform Date to NgbDataStruct, then CustomNgbDateFormatter to transform NgbDataStruct to requested date format (eg. dd.MM.yyyy). Because angular's pipe does not provide 'revers transform method' (eg. parse) we need to handle view->model binding separately. So, please handle this request. :-) |
This comment has been minimized.
This comment has been minimized.
Hello all, B.R |
Plus, adding aria-expanded on the datepicker pop up, It will be awesome. On my side, using your date picker, I was able to add aria.haspopup on the button opening the calendar, a setfocus on the input when using button for selecting today date. |
At the moment we have a bug, that we lose focus completely after the datepicker closure (#3317). We'll fix it by restoring focus to what was focused before the datepicker was opened. If it was opened from the input → input will be refocused, if it was opened from the triggering button → the triggering button will be refocused. If you don't like re-focusing of the triggered button, you can always FORCE restore focus to the input via the <input #i ngbDatepicker (closed)="i.focus()" /> |
@maxokorokov I dont understand how your last comment is anyhow related to the feature request? |
When select date on calendar, input control should get focus.
The text was updated successfully, but these errors were encountered: