Skip to content

Commit 71c8257

Browse files
Ryan Greyoriondean
authored andcommitted
fix: Thousands action having null handler
We want to classify thousands delimiter as being an invalid key press
1 parent 983f950 commit 71c8257

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/finput.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ class Finput {
155155
const handlerForAction = {
156156
[ACTION_TYPES.NUMBER]: keyHandlers.onNumber,
157157
[ACTION_TYPES.DECIMAL]: keyHandlers.onDecimal,
158+
[ACTION_TYPES.THOUSANDS]: keyHandlers.onThousands,
158159
[ACTION_TYPES.MINUS]: keyHandlers.onMinus,
159160
[ACTION_TYPES.SHORTCUT]: keyHandlers.onShortcut,
160161
[ACTION_TYPES.BACKSPACE]: keyHandlers.onBackspace,

src/keyHandlers.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ module.exports = {
9898
return newState;
9999
},
100100

101+
/**
102+
* THOUSANDS HANDLER
103+
* @param {currentState} Information about current finput state
104+
*/
105+
onThousands: function (currentState, keyInfo, options) {
106+
const newState = { ...currentState };
107+
newState.valid = false;
108+
return newState;
109+
},
110+
101111
/**
102112
* SHORTCUT HANDLER
103113
* @param {currentState} Information about current finput state

0 commit comments

Comments
 (0)