From 2444bed1ac685e06e418f64ab2996df344213c04 Mon Sep 17 00:00:00 2001 From: Nikolai Norona Date: Tue, 26 Jul 2022 11:43:20 -0400 Subject: [PATCH] Add Tab Support to InputNumber (within Datatable) (#3110) * 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. * update comment update comment to reflect new functionality --- components/lib/inputnumber/InputNumber.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/lib/inputnumber/InputNumber.js b/components/lib/inputnumber/InputNumber.js index de545499e9..deed9c41a0 100644 --- a/components/lib/inputnumber/InputNumber.js +++ b/components/lib/inputnumber/InputNumber.js @@ -341,8 +341,9 @@ export const InputNumber = React.memo(React.forwardRef((props, ref) => { } break; - //enter + //enter and tab case 13: + case 9: newValueStr = validateValue(parseValue(inputValue)); inputRef.current.value = formatValue(newValueStr); inputRef.current.setAttribute('aria-valuenow', newValueStr);