Skip to content

Commit

Permalink
Add Tab Support to InputNumber (within Datatable) (#3110)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
purxiz authored Jul 26, 2022
1 parent 0d79645 commit 2444bed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/lib/inputnumber/InputNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2444bed

Please sign in to comment.