diff --git a/components/lib/accordion/Accordion.js b/components/lib/accordion/Accordion.js index 4d96b61a6b..37eb772670 100644 --- a/components/lib/accordion/Accordion.js +++ b/components/lib/accordion/Accordion.js @@ -106,6 +106,7 @@ export const Accordion = React.forwardRef((inProps, ref) => { break; case 'Enter': + case 'NumpadEnter': case 'Space': onTabEnterKey(event, tab, index); break; diff --git a/components/lib/calendar/Calendar.js b/components/lib/calendar/Calendar.js index e3c5cbfeda..afd6a35bf0 100644 --- a/components/lib/calendar/Calendar.js +++ b/components/lib/calendar/Calendar.js @@ -218,7 +218,7 @@ export const Calendar = React.memo( }; const onPickerKeyDown = (event, type, direction) => { - if (event.code === 'Enter' || event.code === 'Space') { + if (event.key === 'Enter' || event.key === 'Space') { onTimePickerElementMouseDown(event, type, direction); event.preventDefault(); @@ -229,7 +229,7 @@ export const Calendar = React.memo( }; const onPickerKeyUp = (event) => { - if (event.code === 'Enter' || event.code === 'Space') { + if (event.key === 'Enter' || event.key === 'Space') { onTimePickerElementMouseUp(); event.preventDefault(); @@ -1670,7 +1670,7 @@ export const Calendar = React.memo( }; const switchToMonthView = (event) => { - if (event && event.code && (event.code === 'Enter' || event.code === 'Space')) { + if (event && event.code && (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space')) { viewChangedWithKeyDown.current = true; } @@ -1679,7 +1679,7 @@ export const Calendar = React.memo( }; const switchToYearView = (event) => { - if (event && event.code && (event.code === 'Enter' || event.code === 'Space')) { + if (event && event.code && (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space')) { viewChangedWithKeyDown.current = true; } diff --git a/components/lib/chip/Chip.js b/components/lib/chip/Chip.js index 0e3b9af89f..5e7085fdad 100644 --- a/components/lib/chip/Chip.js +++ b/components/lib/chip/Chip.js @@ -20,7 +20,7 @@ export const Chip = React.memo( useHandleStyle(ChipBase.css.styles, isUnstyled, { name: 'chip' }); const onKeyDown = (event) => { - if (event.code === 'Enter' || event.code === 'Backspace') { + if (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Backspace') { close(event); } }; diff --git a/components/lib/contextmenu/ContextMenu.js b/components/lib/contextmenu/ContextMenu.js index 892f28239c..14f6eca0f8 100644 --- a/components/lib/contextmenu/ContextMenu.js +++ b/components/lib/contextmenu/ContextMenu.js @@ -384,6 +384,7 @@ export const ContextMenu = React.memo( break; case 'Enter': + case 'NumpadEnter': onEnterKey(event); break; diff --git a/components/lib/datatable/BodyCell.js b/components/lib/datatable/BodyCell.js index 2f1b35c792..42104ad9c0 100644 --- a/components/lib/datatable/BodyCell.js +++ b/components/lib/datatable/BodyCell.js @@ -362,7 +362,7 @@ export const BodyCell = React.memo((props) => { const onKeyDown = (event) => { if (props.editMode !== 'row') { - if (event.code === 'Enter' || event.code === 'Tab') { + if (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Tab') { switchCellToViewMode(event, true); } diff --git a/components/lib/datatable/BodyRow.js b/components/lib/datatable/BodyRow.js index 670b92af21..294c1e567d 100644 --- a/components/lib/datatable/BodyRow.js +++ b/components/lib/datatable/BodyRow.js @@ -179,6 +179,7 @@ export const BodyRow = React.memo((props) => { break; case 'Enter': + case 'NumpadEnter': onEnterKey(row, event, target); break; diff --git a/components/lib/datatable/HeaderCell.js b/components/lib/datatable/HeaderCell.js index b85ff3376a..ba09f28238 100644 --- a/components/lib/datatable/HeaderCell.js +++ b/components/lib/datatable/HeaderCell.js @@ -169,7 +169,7 @@ export const HeaderCell = React.memo((props) => { }; const onKeyDown = (event) => { - if ((event.code == 'Enter' || event.code == 'Space') && event.currentTarget === elementRef.current && DomHandler.getAttribute(event.currentTarget, 'data-p-sortable-column') === 'true') { + if ((event.code == 'Enter' || event.code === 'NumpadEnter' || event.code == 'Space') && event.currentTarget === elementRef.current && DomHandler.getAttribute(event.currentTarget, 'data-p-sortable-column') === 'true') { onClick(event); event.preventDefault(); diff --git a/components/lib/dock/Dock.js b/components/lib/dock/Dock.js index 9abf680f42..f3579a35a6 100644 --- a/components/lib/dock/Dock.js +++ b/components/lib/dock/Dock.js @@ -97,6 +97,7 @@ export const Dock = React.memo( break; case 'Enter': + case 'NumpadEnter': case 'Space': onSpaceKey(event); event.preventDefault(); diff --git a/components/lib/dropdown/Dropdown.js b/components/lib/dropdown/Dropdown.js index 3e2bd1a7a1..a1ce1d63e1 100644 --- a/components/lib/dropdown/Dropdown.js +++ b/components/lib/dropdown/Dropdown.js @@ -267,6 +267,7 @@ export const Dropdown = React.memo( case 'Escape': case 'Enter': + case 'NumpadEnter': onEnterKey(event); event.preventDefault(); break; diff --git a/components/lib/fieldset/Fieldset.js b/components/lib/fieldset/Fieldset.js index 1215b8fac1..e0a1ba0524 100644 --- a/components/lib/fieldset/Fieldset.js +++ b/components/lib/fieldset/Fieldset.js @@ -69,7 +69,7 @@ export const Fieldset = React.forwardRef((inProps, ref) => { }); const onKeyDown = (event) => { - if (event.code === 'Enter' || event.code === 'Space') { + if (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') { toggle(event); event.preventDefault(); } diff --git a/components/lib/fileupload/FileUpload.js b/components/lib/fileupload/FileUpload.js index 646c6bc838..8f3c714772 100644 --- a/components/lib/fileupload/FileUpload.js +++ b/components/lib/fileupload/FileUpload.js @@ -292,7 +292,7 @@ export const FileUpload = React.memo( }; const onKeyDown = (event) => { - if (event.code === 'Enter') { + if (event.code === 'Enter' || event.code === 'NumpadEnter') { choose(); } }; diff --git a/components/lib/galleria/GalleriaItem.js b/components/lib/galleria/GalleriaItem.js index fae40c0b93..5c8106c5a5 100644 --- a/components/lib/galleria/GalleriaItem.js +++ b/components/lib/galleria/GalleriaItem.js @@ -88,6 +88,7 @@ export const GalleriaItem = React.memo( const onIndicatorKeyDown = (event, index) => { switch (event.code) { case 'Enter': + case 'NumpadEnter': case 'Space': stopSlideShow(); diff --git a/components/lib/galleria/GalleriaThumbnails.js b/components/lib/galleria/GalleriaThumbnails.js index ce857f9c3f..5f125742d1 100644 --- a/components/lib/galleria/GalleriaThumbnails.js +++ b/components/lib/galleria/GalleriaThumbnails.js @@ -31,7 +31,7 @@ const GalleriaThumbnailItem = React.memo((props) => { }; const onThumbnailKeydown = (event) => { - if (event.code === 'Enter' || event.code === 'Space') { + if (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') { props.onItemClick({ originalEvent: event, index: props.index diff --git a/components/lib/inplace/Inplace.js b/components/lib/inplace/Inplace.js index 9bc041b290..16243eff43 100644 --- a/components/lib/inplace/Inplace.js +++ b/components/lib/inplace/Inplace.js @@ -63,7 +63,7 @@ export const Inplace = React.forwardRef((inProps, ref) => { }; const onDisplayKeyDown = (event) => { - if (event.code === 'Enter' || event.code === 'Space') { + if (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') { open(event); event.preventDefault(); } diff --git a/components/lib/inputnumber/InputNumber.js b/components/lib/inputnumber/InputNumber.js index 8ea484a107..f2bab87d20 100644 --- a/components/lib/inputnumber/InputNumber.js +++ b/components/lib/inputnumber/InputNumber.js @@ -377,6 +377,7 @@ export const InputNumber = React.memo( case 'Tab': case 'NumpadEnter': case 'Enter': + case 'NumpadEnter': newValueStr = validateValue(parseValue(inputValue)); inputRef.current.value = formatValue(newValueStr); inputRef.current.setAttribute('aria-valuenow', newValueStr); diff --git a/components/lib/megamenu/MegaMenu.js b/components/lib/megamenu/MegaMenu.js index fa823eee67..73f60591b7 100644 --- a/components/lib/megamenu/MegaMenu.js +++ b/components/lib/megamenu/MegaMenu.js @@ -391,6 +391,7 @@ export const MegaMenu = React.memo( break; case 'Enter': + case 'NumpadEnter': onEnterKey(event); break; @@ -406,7 +407,6 @@ export const MegaMenu = React.memo( case 'PageUp': case 'Backspace': case 'ShiftLeft': - focusedItemInfo; case 'ShiftRight': //NOOP break; diff --git a/components/lib/menu/Menu.js b/components/lib/menu/Menu.js index 0f7b948491..5e412859d6 100644 --- a/components/lib/menu/Menu.js +++ b/components/lib/menu/Menu.js @@ -131,6 +131,7 @@ export const Menu = React.memo( break; case 'Enter': + case 'NumpadEnter': onEnterKey(event); break; diff --git a/components/lib/menubar/Menubar.js b/components/lib/menubar/Menubar.js index 847fd9d2f2..c41a4ac48a 100644 --- a/components/lib/menubar/Menubar.js +++ b/components/lib/menubar/Menubar.js @@ -96,7 +96,7 @@ export const Menubar = React.memo( }; const menuButtonKeydown = (event) => { - (event.code === 'Enter' || event.code === 'Space') && toggle(event); + (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') && toggle(event); }; const isOutsideClicked = (event) => { @@ -167,6 +167,7 @@ export const Menubar = React.memo( break; case 'Enter': + case 'NumpadEnter': onEnterKey(event); break; diff --git a/components/lib/speeddial/SpeedDial.js b/components/lib/speeddial/SpeedDial.js index bbf543ade4..f692bdb36f 100644 --- a/components/lib/speeddial/SpeedDial.js +++ b/components/lib/speeddial/SpeedDial.js @@ -106,6 +106,7 @@ export const SpeedDial = React.memo( break; case 'Enter': + case 'NumpadEnter': case 'Space': onEnterKey(event); break; diff --git a/components/lib/splitter/Splitter.js b/components/lib/splitter/Splitter.js index 6cddd15d13..962163df76 100644 --- a/components/lib/splitter/Splitter.js +++ b/components/lib/splitter/Splitter.js @@ -266,6 +266,8 @@ export const Splitter = React.memo( break; } + case 'NumpadEnter': + case 'Enter': { if (prevSize.current >= 100 - (minSize || 5)) { resizePanel(index, minSize, 100 - minSize); diff --git a/components/lib/steps/Steps.js b/components/lib/steps/Steps.js index f5dc862a1f..d9c64d538b 100644 --- a/components/lib/steps/Steps.js +++ b/components/lib/steps/Steps.js @@ -84,6 +84,7 @@ export const Steps = React.memo( break; case 'Enter': + case 'NumpadEnter': case 'Space': itemClick(event, item, index); event.preventDefault(); diff --git a/components/lib/tabmenu/TabMenu.js b/components/lib/tabmenu/TabMenu.js index f159114f75..541dfbf3d0 100644 --- a/components/lib/tabmenu/TabMenu.js +++ b/components/lib/tabmenu/TabMenu.js @@ -138,6 +138,7 @@ export const TabMenu = React.memo( case 'Space': case 'Enter': + case 'NumpadEnter': itemClick(event, item, index); event.preventDefault(); break; diff --git a/components/lib/tabview/TabView.js b/components/lib/tabview/TabView.js index c491279982..63743a9cd3 100644 --- a/components/lib/tabview/TabView.js +++ b/components/lib/tabview/TabView.js @@ -149,6 +149,7 @@ export const TabView = React.forwardRef((inProps, ref) => { break; case 'Enter': + case 'NumpadEnter': case 'Space': onTabEnterKey(event, tab, index); break; diff --git a/components/lib/terminal/Terminal.js b/components/lib/terminal/Terminal.js index 29cb420a79..acaa97fb76 100644 --- a/components/lib/terminal/Terminal.js +++ b/components/lib/terminal/Terminal.js @@ -58,6 +58,7 @@ export const Terminal = React.memo( break; case 'Enter': + case 'NumpadEnter': if (!!commandTextState) { let newCommands = [...commandsState]; diff --git a/components/lib/tieredmenu/TieredMenu.js b/components/lib/tieredmenu/TieredMenu.js index ffd1070bbc..9d037dffcf 100644 --- a/components/lib/tieredmenu/TieredMenu.js +++ b/components/lib/tieredmenu/TieredMenu.js @@ -153,6 +153,7 @@ export const TieredMenu = React.memo( break; case 'Enter': + case 'NumpadEnter': onEnterKey(event); break; diff --git a/components/lib/treetable/TreeTableHeader.js b/components/lib/treetable/TreeTableHeader.js index 382d050877..5d2bed3498 100644 --- a/components/lib/treetable/TreeTableHeader.js +++ b/components/lib/treetable/TreeTableHeader.js @@ -64,7 +64,7 @@ export const TreeTableHeader = React.memo((props) => { }; const onHeaderKeyDown = (event, column) => { - if (event.key === 'Enter' && event.key === 'Space') { + if (event.key === 'Enter' || event.code === 'Space') { onHeaderClick(event, column); event.preventDefault(); } diff --git a/components/lib/tristatecheckbox/TriStateCheckbox.js b/components/lib/tristatecheckbox/TriStateCheckbox.js index c7dc31975b..642f540348 100644 --- a/components/lib/tristatecheckbox/TriStateCheckbox.js +++ b/components/lib/tristatecheckbox/TriStateCheckbox.js @@ -61,7 +61,7 @@ export const TriStateCheckbox = React.memo( }; const onKeyDown = (e) => { - if (e.code === 'Enter' || e.code === 'Space') { + if (e.code === 'Enter' || e.code === 'NumpadEnter' || e.code === 'Space') { onChange(e); e.preventDefault(); }