mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
fix key value input field
This commit is contained in:
@@ -75,6 +75,12 @@ const AddKeyValueEntryToTableField: FC<Props> = ({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const add = () => {
|
||||||
|
addEntry(key, value);
|
||||||
|
setKey("")
|
||||||
|
setValue("");
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<InputLevel>
|
<InputLevel>
|
||||||
<StyledInputField
|
<StyledInputField
|
||||||
@@ -83,7 +89,7 @@ const AddKeyValueEntryToTableField: FC<Props> = ({
|
|||||||
onChange={setKey}
|
onChange={setKey}
|
||||||
validationError={!isValid(key)}
|
validationError={!isValid(key)}
|
||||||
value={key}
|
value={key}
|
||||||
onReturnPressed={() => addEntry(key, value)}
|
onReturnPressed={add}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
helpText={keyHelpText}
|
helpText={keyHelpText}
|
||||||
/>
|
/>
|
||||||
@@ -93,13 +99,13 @@ const AddKeyValueEntryToTableField: FC<Props> = ({
|
|||||||
onChange={setValue}
|
onChange={setValue}
|
||||||
validationError={!isValid(value)}
|
validationError={!isValid(value)}
|
||||||
value={value}
|
value={value}
|
||||||
onReturnPressed={() => addEntry(key, value)}
|
onReturnPressed={add}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
helpText={valueHelpText}
|
helpText={valueHelpText}
|
||||||
/>
|
/>
|
||||||
<MarginTopButton
|
<MarginTopButton
|
||||||
label={buttonLabel}
|
label={buttonLabel}
|
||||||
action={() => addEntry(key, value)}
|
action={add}
|
||||||
disabled={disabled || !key || !value || !isValid(key) || !isValid(value)}
|
disabled={disabled || !key || !value || !isValid(key) || !isValid(value)}
|
||||||
/>
|
/>
|
||||||
</InputLevel>
|
</InputLevel>
|
||||||
|
|||||||
Reference in New Issue
Block a user