Skip to content

Commit

Permalink
Fixed #3602 - Keyboard support: Numpad enter
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Dec 20, 2023
1 parent f887f97 commit e0de315
Show file tree
Hide file tree
Showing 38 changed files with 45 additions and 14 deletions.
1 change: 1 addition & 0 deletions components/lib/accordion/Accordion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export default {
break;
case 'Enter':
case 'NumpadEnter':
case 'Space':
this.onTabEnterKey(event, tab, index);
break;
Expand Down
3 changes: 3 additions & 0 deletions components/lib/calendar/Calendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2185,6 +2185,7 @@ export default {
}
case 'Enter':
case 'NumpadEnter':
case 'Space': {
this.onDateSelect(event, date);
Expand Down Expand Up @@ -2361,6 +2362,7 @@ export default {
}
case 'Enter':
case 'NumpadEnter':
case 'Space': {
this.onMonthSelect(event, index);
Expand Down Expand Up @@ -2454,6 +2456,7 @@ export default {
}
case 'Enter':
case 'NumpadEnter':
case 'Space': {
this.onYearSelect(event, index);
Expand Down
1 change: 1 addition & 0 deletions components/lib/cascadeselect/CascadeSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ export default {
break;
case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event);
break;
Expand Down
1 change: 1 addition & 0 deletions components/lib/chips/Chips.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export default {
break;
case 'Enter':
case 'NumpadEnter':
if (inputValue && inputValue.trim().length && !this.maxedOut) {
this.addItem(event, inputValue, true);
}
Expand Down
4 changes: 2 additions & 2 deletions components/lib/confirmpopup/ConfirmPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ export default {
this.visible = false;
},
onAcceptKeydown(event) {
if (event.code === 'Space' || event.code === 'Enter') {
if (event.code === 'Space' || event.code === 'Enter' || event.code === 'NumpadEnter') {
this.accept();
DomHandler.focus(this.target);
event.preventDefault();
}
},
onRejectKeydown(event) {
if (event.code === 'Space' || event.code === 'Enter') {
if (event.code === 'Space' || event.code === 'Enter' || event.code === 'NumpadEnter') {
this.reject();
DomHandler.focus(this.target);
event.preventDefault();
Expand Down
1 change: 1 addition & 0 deletions components/lib/contextmenu/ContextMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ export default {
break;
case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event);
break;
Expand Down
1 change: 1 addition & 0 deletions components/lib/datatable/ColumnFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ export default {
onToggleButtonKeyDown(event) {
switch (event.code) {
case 'Enter':
case 'NumpadEnter':
case 'Space':
this.toggleMenu(event);
Expand Down
1 change: 1 addition & 0 deletions components/lib/datatable/DataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,7 @@ export default {
break;
case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event, rowData, rowIndex);
break;
Expand Down
2 changes: 1 addition & 1 deletion components/lib/datatable/HeaderCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export default {
this.$emit('column-click', { originalEvent: event, column: this.column });
},
onKeyDown(event) {
if ((event.code === 'Enter' || event.code === 'Space') && event.currentTarget.nodeName === 'TH' && DomHandler.getAttribute(event.currentTarget, 'data-p-sortable-column')) {
if ((event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') && event.currentTarget.nodeName === 'TH' && DomHandler.getAttribute(event.currentTarget, 'data-p-sortable-column')) {
this.$emit('column-click', { originalEvent: event, column: this.column });
event.preventDefault();
}
Expand Down
1 change: 1 addition & 0 deletions components/lib/dock/DockSub.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ export default {
}
case 'Enter':
case 'NumpadEnter':
case 'Space': {
this.onSpaceKey(event);
Expand Down
1 change: 1 addition & 0 deletions components/lib/dropdown/Dropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ export default {
break;
case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event);
break;
Expand Down
2 changes: 1 addition & 1 deletion components/lib/fieldset/Fieldset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default {
});
},
onKeyDown(event) {
if (event.code === 'Enter' || event.code === 'Space') {
if (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') {
this.toggle(event);
event.preventDefault();
}
Expand Down
1 change: 1 addition & 0 deletions components/lib/galleria/GalleriaItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ export default {
onIndicatorKeyDown(event, index) {
switch (event.code) {
case 'Enter':
case 'NumpadEnter':
case 'Space':
this.stopSlideShow();
Expand Down
2 changes: 1 addition & 1 deletion components/lib/galleria/GalleriaThumbnails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ export default {
}
},
onThumbnailKeydown(event, index) {
if (event.code === 'Enter' || event.code === 'Space') {
if (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') {
this.onItemClick(index);
event.preventDefault();
}
Expand Down
2 changes: 2 additions & 0 deletions components/lib/listbox/Listbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ export default {
break;
case 'Enter':
case 'NumpadEnter':
case 'Space':
this.onSpaceKey(event);
break;
Expand Down Expand Up @@ -414,6 +415,7 @@ export default {
break;
case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event);
break;
Expand Down
3 changes: 2 additions & 1 deletion components/lib/megamenu/MegaMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ export default {
break;
case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event);
break;
Expand Down Expand Up @@ -300,7 +301,7 @@ export default {
this.toggle(event);
},
menuButtonKeydown(event) {
(event.code === 'Enter' || event.code === 'Space') && this.menuButtonClick(event);
(event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') && this.menuButtonClick(event);
},
onArrowDownKey(event) {
if (this.horizontal) {
Expand Down
1 change: 1 addition & 0 deletions components/lib/menu/Menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ export default {
break;
case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event);
break;
Expand Down
3 changes: 2 additions & 1 deletion components/lib/menubar/Menubar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ export default {
break;
case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event);
break;
Expand Down Expand Up @@ -292,7 +293,7 @@ export default {
this.toggle(event);
},
menuButtonKeydown(event) {
(event.code === 'Enter' || event.code === 'Space') && this.menuButtonClick(event);
(event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') && this.menuButtonClick(event);
},
onArrowDownKey(event) {
const processedItem = this.visibleItems[this.focusedItemInfo.index];
Expand Down
2 changes: 2 additions & 0 deletions components/lib/multiselect/MultiSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ export default {
break;
case 'Enter':
case 'NumpadEnter':
case 'Space':
this.onEnterKey(event);
break;
Expand Down Expand Up @@ -511,6 +512,7 @@ export default {
break;
case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event);
break;
Expand Down
1 change: 1 addition & 0 deletions components/lib/orderlist/OrderList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export default {
break;
case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event);
break;
Expand Down
2 changes: 1 addition & 1 deletion components/lib/organizationchart/OrganizationChartNode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default {
this.$emit('node-toggle', node);
},
onKeydown(event) {
if (event.code === 'Enter' || event.code === 'Space') {
if (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') {
this.toggleNode();
event.preventDefault();
}
Expand Down
2 changes: 1 addition & 1 deletion components/lib/panel/Panel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default {
});
},
onKeyDown(event) {
if (event.code === 'Enter' || event.code === 'Space') {
if (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') {
this.toggle(event);
event.preventDefault();
}
Expand Down
1 change: 1 addition & 0 deletions components/lib/panelmenu/PanelMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ export default {
break;
case 'Enter':
case 'NumpadEnter':
case 'Space':
this.onHeaderEnterKey(event, item);
break;
Expand Down
1 change: 1 addition & 0 deletions components/lib/panelmenu/PanelMenuList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export default {
break;
case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event);
break;
Expand Down
1 change: 1 addition & 0 deletions components/lib/picklist/PickList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ export default {
break;
case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event, listType);
break;
Expand Down
1 change: 1 addition & 0 deletions components/lib/speeddial/SpeedDial.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ export default {
break;
case 'Enter':
case 'NumpadEnter':
case 'Space':
this.onEnterKey(event);
break;
Expand Down
1 change: 1 addition & 0 deletions components/lib/steps/Steps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export default {
break;
case 'Enter':
case 'NumpadEnter':
case 'Space': {
this.onItemClick(event, item);
Expand Down
1 change: 1 addition & 0 deletions components/lib/tabmenu/TabMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export default {
}
case 'Space':
case 'NumpadEnter':
case 'Enter': {
this.onItemClick(event, item, index);
Expand Down
1 change: 1 addition & 0 deletions components/lib/tabview/TabView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ export default {
break;
case 'Enter':
case 'NumpadEnter':
case 'Space':
this.onTabEnterKey(event, tab, index);
break;
Expand Down
2 changes: 1 addition & 1 deletion components/lib/terminal/Terminal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default {
this.$refs.input.focus();
},
onKeydown(event) {
if (event.code === 'Enter' && this.commandText) {
if ((event.code === 'Enter' || event.code === 'NumpadEnter') && this.commandText) {
this.commands.push({ text: this.commandText });
TerminalService.emit('command', this.commandText);
this.commandText = '';
Expand Down
1 change: 1 addition & 0 deletions components/lib/tieredmenu/TieredMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export default {
break;
case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event);
break;
Expand Down
2 changes: 1 addition & 1 deletion components/lib/tree/Tree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export default {
return node.leaf === false ? false : !(node.children && node.children.length);
},
onFilterKeydown(event) {
if (event.code === 'Enter') {
if (event.code === 'Enter' || event.code === 'NumpadEnter') {
event.preventDefault();
}
Expand Down
1 change: 1 addition & 0 deletions components/lib/tree/TreeNode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ export default {
break;
case 'Enter':
case 'NumpadEnter':
case 'Space':
this.onEnterKey(event);
Expand Down
1 change: 1 addition & 0 deletions components/lib/treeselect/TreeSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ export default {
case 'Space':
case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event);
break;
Expand Down
2 changes: 1 addition & 1 deletion components/lib/treetable/HeaderCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export default {
this.$emit('column-click', { originalEvent: event, column: this.column });
},
onKeyDown(event) {
if ((event.code === 'Enter' || event.code === 'Space') && event.currentTarget.nodeName === 'TH' && DomHandler.getAttribute(event.currentTarget, 'data-p-sortable-column')) {
if ((event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') && event.currentTarget.nodeName === 'TH' && DomHandler.getAttribute(event.currentTarget, 'data-p-sortable-column')) {
this.$emit('column-click', { originalEvent: event, column: this.column });
event.preventDefault();
Expand Down
2 changes: 1 addition & 1 deletion components/lib/treetable/TreeTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ export default {
}
},
onColumnKeyDown(event, col) {
if (event.code === 'Enter' && event.currentTarget.nodeName === 'TH' && DomHandler.getAttribute(event.currentTarget, 'data-p-sortable-column')) {
if ((event.code === 'Enter' || event.code === 'NumpadEnter') && event.currentTarget.nodeName === 'TH' && DomHandler.getAttribute(event.currentTarget, 'data-p-sortable-column')) {
this.onColumnHeaderClick(event, col);
}
},
Expand Down
1 change: 1 addition & 0 deletions components/lib/treetable/TreeTableRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ export default {
break;
case 'Enter':
case 'NumpadEnter':
case 'Space':
if (!DomHandler.isClickable(event.target)) {
this.onEnterKey(event, item);
Expand Down
2 changes: 1 addition & 1 deletion components/lib/tristatecheckbox/TriStateCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default {
this.$refs.input.focus();
},
onKeyDown(event) {
if (event.code === 'Enter') {
if (event.code === 'Enter' || event.code === 'NumpadEnter') {
this.updateModel();
this.$emit('keydown', event);
event.preventDefault();
Expand Down

0 comments on commit e0de315

Please sign in to comment.