diff --git a/packages/desktop-client/src/components/table.tsx b/packages/desktop-client/src/components/table.tsx index 59ff2f19565..96fd84131b6 100644 --- a/packages/desktop-client/src/components/table.tsx +++ b/packages/desktop-client/src/components/table.tsx @@ -339,11 +339,25 @@ function InputValue({ } } + const ops = ['+', '-', '*', '/', '^']; + + function valueIsASingleOperator(text) { + return text?.length === 1 && ops.includes(text.charAt(0)); + } + + function setValue_(text) { + if (valueIsASingleOperator(text)) { + setValue(defaultValue + text); + } else { + setValue(text); + } + } + return ( setValue(text)} + onChangeValue={text => setValue_(text)} onBlur={onBlur_} onUpdate={onUpdate} onKeyDown={onKeyDown}