-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix(module:time-picker): make keyboard navigation possible #3145
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -6,7 +6,8 @@ | |||||
[placeholder]="nzPlaceHolder || ('TimePicker.placeholder' | nzI18n)" | ||||||
[(ngModel)]="value" | ||||||
readonly="readonly" | ||||||
(click)="open()"> | ||||||
(click)="open()" | ||||||
(keyup.enter)="open()"> | ||||||
<span class="ant-time-picker-icon"> | ||||||
<i nz-icon nzType="clock-circle"></i> | ||||||
</span> | ||||||
|
@@ -50,7 +51,9 @@ | |||||
[opened]="nzOpen" | ||||||
[nzClearText]="nzClearText" | ||||||
[nzAllowEmpty]="nzAllowEmpty" | ||||||
(keyup.enter)="close()" | ||||||
[(ngModel)]="value"> | ||||||
</nz-time-picker-panel> | ||||||
<span tabindex="0" (focus)="close()" class="nz-tab-catching-span"></span> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
In theory the focus point should be moved to time picker panel when pressing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You mean the same way as it is done in the react version: https://ant.design/components/time-picker/ ? But I am sure this is a UX bug in that version. This behaviour would be completely unusable with a keyboard. You need to press tab about a hundred times to get anything done there. In reality, choosing time on the time-picker is not needed if the user is already using the keyboard. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The right way is: Users use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Really? In order to input the time this way in the worst case the user needs 12 + 30 + 30 keystrokes. The way I see its usage is that: Of course, one could implement a special form for the case b), but if the standard component could do it, why not try with a standard one? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to support to cover everywhere of the panel only use keyboard, I mean use |
||||||
</ng-template> | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should add the tests about your changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added tests.