-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat(module:date-picker): support DOWN_ARROW/UP_ARROW/LEFT_ARROW/RIGH… #2237
Conversation
d294f8a
to
ffd7068
Compare
Codecov Report
@@ Coverage Diff @@
## master #2237 +/- ##
==========================================
+ Coverage 95.5% 95.57% +0.07%
==========================================
Files 495 486 -9
Lines 12098 12053 -45
Branches 1689 1608 -81
==========================================
- Hits 11554 11520 -34
- Misses 172 186 +14
+ Partials 372 347 -25
Continue to review full report at Codecov.
|
ffd7068
to
ec4169c
Compare
…T_ARROW/PAGE_DOWN/PAGE_UP/ENTER hotkeys close NG-ZORRO#2094
ec4169c
to
9f632a0
Compare
39d51ce
to
4bff7af
Compare
Some other components like select, cascader have similar behaviors. Should abstract these behaviors in another pr later. |
@@ -741,6 +867,11 @@ describe('NzDatePickerComponent', () => { | |||
fixture.detectChanges(); | |||
} | |||
|
|||
function triggerKeydown(node: Node, keyCode: number, ctrlKey: boolean = false, metaKey: boolean = false): void { | |||
// tslint:disable-next-line:no-any | |||
dispatchEvent(node, new KeyboardEvent('keydown', { keyCode, ctrlKey, metaKey } as any)); // NOTE: don't use `dispatchKeyboardEvent` (not reliable), it will always set `event.metaKey` tobe `true` |
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.
s/tobe/to be
} | ||
|
||
const ctrlKey = event.ctrlKey || event.metaKey; // NOTE: metaKey is the "⌘ Command" key on `MAC` and the "⊞ Windows" key on `Windows` | ||
switch (event.keyCode) { |
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.
Maybe it is a good idea that the event.preventDefault()
should be outside the switch block
@wilsoncook rebase needed. |
As there is no update for a long time, the current PR has been closed. If you have any questions, feel free to open another PR, thanks. |
…T_ARROW/PAGE_DOWN/PAGE_UP/ENTER hotkeys
close #2094
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #2094
What is the new behavior?
Does this PR introduce a breaking change?
Other information