Skip to content

Commit fe8fb06

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent 79a44b5 commit fe8fb06

File tree

5 files changed

+90
-8
lines changed

5 files changed

+90
-8
lines changed

docs/intro/installation/prerequisites.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ The following table provides a list of the jQuery versions that are compatible w
2727

2828
| Major Releases | jQuery Version | Comments |
2929
| :--- | :--- | :--- |
30+
| [Kendo UI 2018.3.911 (R3 2018)](https://www.telerik.com/support/whats-new/kendo-ui/release-history/kendo-ui-r3-2018) |1.12.4| Also compatible with 1.10.x, 2.2.x and 3.3.1|
3031
| [Kendo UI 2018.2.516 (R2 2018)](https://www.telerik.com/support/whats-new/kendo-ui/release-history/kendo-ui-r2-2018) |1.12.4| Also compatible with 1.10.x, 2.2.x and 3.3.1|
3132
| [Kendo UI 2018.1.117 (R1 2018)](https://www.telerik.com/support/whats-new/kendo-ui/release-history/kendo-ui-r1-2018) |1.12.4| Also compatible with 1.10.x, 2.2.x and 3.1.1|
3233
| [Kendo UI 2017.3.913 (R3 2017)](https://www.telerik.com/support/whats-new/kendo-ui/release-history/kendo-ui-r3-2017) |1.12.3| Also compatible with 1.10.x, 2.2.x and 3.1.1|

src/kendo.multiselect.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -790,15 +790,15 @@ var __meta__ = { // jshint ignore:line
790790
that._activeItem = listView.focus();
791791
dir = -1;
792792
}
793-
activeItemIdx = listView.getElementIndex(that._getActiveItem()[0]);
793+
activeItemIdx = listView.getElementIndex(that._getActiveItem().first());
794794

795795
listView.focusNext();
796796
if (!listView.focus()) {
797797
listView.focusLast();
798798
} else {
799799
if (e.shiftKey) {
800800
this._multipleSelection = true;
801-
that._selectRange(activeItemIdx, listView.getElementIndex(listView.focus()[0]) + dir);
801+
that._selectRange(activeItemIdx, listView.getElementIndex(listView.focus().first()) + dir);
802802
}
803803
}
804804
} else {
@@ -811,14 +811,14 @@ var __meta__ = { // jshint ignore:line
811811
that._activeItem = listView.focus();
812812
dir = 1;
813813
}
814-
activeItemIdx = listView.getElementIndex(that._getActiveItem()[0]);
814+
activeItemIdx = listView.getElementIndex(that._getActiveItem().first());
815815
listView.focusPrev();
816816
if (!listView.focus()) {
817817
that.close();
818818
} else {
819819
if (e.shiftKey) {
820820
this._multipleSelection = true;
821-
that._selectRange(activeItemIdx, listView.getElementIndex(listView.focus()[0]) + dir);
821+
that._selectRange(activeItemIdx, listView.getElementIndex(listView.focus().first()) + dir);
822822
}
823823
}
824824
}
@@ -835,7 +835,7 @@ var __meta__ = { // jshint ignore:line
835835
tag = tag.next();
836836
that.currentTag(tag[0] ? tag : null);
837837
}
838-
} else if (e.ctrlKey && !e.altKey && key === keys.A && visible) {
838+
} else if (e.ctrlKey && !e.altKey && key === keys.A && visible && !that.options.virtual) {
839839
this._multipleSelection = true;
840840
if (this._getSelectedIndices().length === listView.items().length) {
841841
that._activeItem = null;
@@ -899,7 +899,7 @@ var __meta__ = { // jshint ignore:line
899899
if (!listView.focus()) {
900900
that.close();
901901
} else {
902-
if (e.ctrlKey && e.shiftKey) {
902+
if (e.ctrlKey && e.shiftKey && !that.options.virtual) {
903903
that._selectRange(listView.getElementIndex(listView.focus()[0]), 0);
904904
}
905905
listView.focusFirst();
@@ -916,7 +916,7 @@ var __meta__ = { // jshint ignore:line
916916
if (!listView.focus()) {
917917
that.close();
918918
} else {
919-
if (e.ctrlKey && e.shiftKey) {
919+
if (e.ctrlKey && e.shiftKey && !that.options.virtual) {
920920
that._selectRange(
921921
listView.getElementIndex(listView.focus()[0]),
922922
listView.element.children().length - 1
@@ -1356,6 +1356,7 @@ var __meta__ = { // jshint ignore:line
13561356
return;
13571357
}
13581358

1359+
that.popup.position();
13591360
that.persistTagList = false;
13601361
return selectIndices(indices);
13611362
},

src/kendo.virtuallist.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ var __meta__ = { // jshint ignore:line
862862
focusLast: function() {
863863
var lastIndex = this.dataSource.total();
864864
this.scrollTo(this.heightContainer.offsetHeight);
865-
this.focus(lastIndex);
865+
this.focus(lastIndex - 1);
866866
},
867867

868868
focusPrev: function() {

tests/multiselect/navigation.js

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,22 @@
171171
equal(multiselect.tagList.children().length, 5);
172172
});
173173

174+
test("MultiSelect dont selects all on CTRL+A", function() {
175+
var multiselect = new MultiSelect(select, {
176+
virtual: true
177+
});
178+
179+
multiselect.open();
180+
181+
multiselect.input.trigger({
182+
type: "keydown",
183+
keyCode: 65,
184+
ctrlKey: true
185+
});
186+
187+
equal(multiselect.tagList.children().length, 0);
188+
});
189+
174190
test("MultiSelect deselects all on CTRL+A if already selected", function() {
175191
var multiselect = new MultiSelect(select);
176192

@@ -503,6 +519,28 @@
503519
equal(multiselect.tagList.children().eq(1).text(), "Option2");
504520
});
505521

522+
test("MultiSelect don't selects multiple items on CTRL+SHIFT+END when virtual", function () {
523+
var multiselect = new MultiSelect(select,{
524+
virtual:true
525+
});
526+
527+
multiselect.open();
528+
529+
multiselect.input.trigger({
530+
type: "keydown",
531+
keyCode: keys.DOWN
532+
});
533+
534+
multiselect.input.trigger({
535+
type: "keydown",
536+
keyCode: keys.END,
537+
ctrlKey: true,
538+
shiftKey: true
539+
});
540+
541+
equal(multiselect.tagList.children().length, 0);
542+
});
543+
506544
test("MultiSelect selects multiple items on CTRL+SHIFT+HOME", function () {
507545
var multiselect = new MultiSelect(select);
508546

@@ -531,6 +569,36 @@
531569
equal(multiselect.tagList.children().length, 4);
532570
});
533571

572+
test("MultiSelect don't selects multiple items on CTRL+SHIFT+HOME when virtual", function () {
573+
var multiselect = new MultiSelect(select, {
574+
virtual:true
575+
});
576+
577+
multiselect.open();
578+
579+
multiselect.input.trigger({
580+
type: "keydown",
581+
keyCode: keys.DOWN
582+
});
583+
multiselect.input.trigger({
584+
type: "keydown",
585+
keyCode: keys.DOWN
586+
});
587+
multiselect.input.trigger({
588+
type: "keydown",
589+
keyCode: keys.DOWN
590+
});
591+
592+
multiselect.input.trigger({
593+
type: "keydown",
594+
keyCode: keys.HOME,
595+
ctrlKey: true,
596+
shiftKey: true
597+
});
598+
599+
equal(multiselect.tagList.children().length, 0);
600+
});
601+
534602
test("MultiSelect respects maxSelectedItems on CTRL+SHIFT+HOME", 3, function () {
535603
var multiselect = new MultiSelect(select, {
536604
maxSelectedItems: 2

tests/virtuallist/api.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,18 @@
763763
});
764764
});
765765

766+
asyncTest("focusLast method focuses last item", 1, function() {
767+
var virtualList = new VirtualList(container, $.extend(virtualSettings, {
768+
selectable: true
769+
}));
770+
771+
asyncDataSource.read().then(function() {
772+
start();
773+
virtualList.focusLast();
774+
equal(virtualList.focusIndex(), 299);
775+
});
776+
});
777+
766778
asyncTest("fcusPrev method focuses last item if there is no currently focused item", 1, function() {
767779
var virtualList = new VirtualList(container, $.extend(virtualSettings, {
768780
selectable: true

0 commit comments

Comments
 (0)