Skip to content

Commit

Permalink
ZK-5517: unable to change the current year with a keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
JamsonChan committed Dec 8, 2023
1 parent e5cfe64 commit 6a889d0
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions zkdoc/release-note
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ZK 10.0.0
ZK-5476: client mvvm failed for a tree
ZK-5037: invisible first column hides checkmarks in a listbox
ZK-5535: TrackerImplEx#removeAllReference accesses map value by iteration instead of key, lowers performance
ZK-5517: unable to change the current year with a keyboard

* Upgrade Notes
+ Upgrade commons-fileupload to commons-fileupload2-javax 2.0.0-M1 and commons-io to 2.13.0 to support jakarta-friendly uploads
Expand Down
16 changes: 16 additions & 0 deletions zktest/src/main/webapp/test2/B100-ZK-5517.zul
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
B100-ZK-5517.zul
Purpose:
Description:
History:
Fri Dec 08 18:18:11 CST 2023, Created by jamson
Copyright (C) 2023 Potix Corporation. All Rights Reserved.
-->
<zk>
<calendar/>
</zk>
1 change: 1 addition & 0 deletions zktest/src/main/webapp/test2/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3164,6 +3164,7 @@ B90-ZK-4431.zul=A,E,Multislider
##zats##B100-ZK-5037.zul=A,E,Listbox,Listheader,Checkmark,invisible
##zats##B100-ZK-5393.zul=A,E,FileUpload,JakartaEE
##zats##B100-ZK-5535.zul=A,E,performance,tree,mvvm,trackerNode,treeModel
##zats##B100-ZK-5517.zul=A,E,calendar,year,keyboard

##
# Features - 3.0.x version
Expand Down
9 changes: 9 additions & 0 deletions zul/src/main/resources/web/js/zul/db/Calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,15 @@ export class Calendar extends zul.Widget {

/** @internal */
override doKeyDown_(evt: zk.Event): void {

// ZK-5517: unable to change the current year with a keyboard
if (evt.shiftKey) {
const view = this._view;
this._view = 'year';
this._shift(evt.key === 'PageUp' ? 1 : evt.key === 'PageDown' ? -1 : 0);
this._view = view;
}

var keyCode = evt.keyCode,
ofs = keyCode == 37 ? -1 : keyCode == 39 ? 1 : keyCode == 38 ? -7 : keyCode == 40 ? 7 : 0;
if (ofs) {
Expand Down

0 comments on commit 6a889d0

Please sign in to comment.