From 723412ba6899ae96a98777a5a5c69a5903765b2f Mon Sep 17 00:00:00 2001 From: Nikolai Norona Date: Tue, 26 Jul 2022 09:36:40 -0400 Subject: [PATCH 1/2] Add Tab Support to InputNumber (within Datatable) When editing an inputnumber in the "cell" edit mode within a datatable, tab does not trigger the onCellEditComplete (or validators), because it is missing from the switch list. I found the same issue with the same solution in PrimeVue: https://github.com/primefaces/primevue/pull/1954/files. --- components/lib/inputnumber/InputNumber.js | 1 + 1 file changed, 1 insertion(+) diff --git a/components/lib/inputnumber/InputNumber.js b/components/lib/inputnumber/InputNumber.js index de545499e9..e790eb8c6a 100644 --- a/components/lib/inputnumber/InputNumber.js +++ b/components/lib/inputnumber/InputNumber.js @@ -343,6 +343,7 @@ export const InputNumber = React.memo(React.forwardRef((props, ref) => { //enter case 13: + case 9: newValueStr = validateValue(parseValue(inputValue)); inputRef.current.value = formatValue(newValueStr); inputRef.current.setAttribute('aria-valuenow', newValueStr); From c79072f44a4ca646fde7ccea03e0e60f22624bd9 Mon Sep 17 00:00:00 2001 From: Nikolai Norona Date: Tue, 26 Jul 2022 10:21:12 -0400 Subject: [PATCH 2/2] update comment update comment to reflect new functionality --- components/lib/inputnumber/InputNumber.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/lib/inputnumber/InputNumber.js b/components/lib/inputnumber/InputNumber.js index e790eb8c6a..deed9c41a0 100644 --- a/components/lib/inputnumber/InputNumber.js +++ b/components/lib/inputnumber/InputNumber.js @@ -341,7 +341,7 @@ export const InputNumber = React.memo(React.forwardRef((props, ref) => { } break; - //enter + //enter and tab case 13: case 9: newValueStr = validateValue(parseValue(inputValue));