removes buttons from number components

This commit is contained in:
Mose Müller
2023-09-14 10:17:25 +02:00
parent bbee77e231
commit ee124ead89
7 changed files with 8 additions and 38 deletions

View File

@ -267,20 +267,6 @@ export const NumberComponent = React.memo((props: NumberComponentProps) => {
setCursorPosition(selectionStart);
};
const handleClick = (event, action: 'plus' | 'minus') => {
const keyAction = action == 'plus' ? 'ArrowUp' : 'ArrowDown';
const { value: newValue } = handleArrowKey(
keyAction,
inputString,
inputString.length,
inputString.length
);
emitUpdate(name, parentPath, Number(newValue));
setInputString(newValue);
};
const handleBlur = () => {
if (!isInstantUpdate) {
// If not in "instant update" mode, emit an update when the input field loses focus
@ -308,22 +294,6 @@ export const NumberComponent = React.memo((props: NumberComponentProps) => {
/>
{unit && <InputGroup.Text>{unit}</InputGroup.Text>}
</InputGroup>
{!readOnly && (
<div className="d-flex flex-column">
<Button
className="numberComponentButton"
variant="outline-secondary"
onClick={(event) => handleClick(event, 'plus')}>
+
</Button>
<Button
className="numberComponentButton"
variant="outline-secondary"
onClick={(event) => handleClick(event, 'minus')}>
-
</Button>
</div>
)}
</div>
</div>
);