mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
refactor: fix form submission avoidance on add constraint (#783)
This commit is contained in:
parent
22f538562d
commit
bc9ae12683
@ -55,10 +55,9 @@ export const FreeTextInput = ({
|
||||
const [inputValues, setInputValues] = useState('');
|
||||
const styles = useStyles();
|
||||
|
||||
const onKeyDown = (event: React.KeyboardEvent) => {
|
||||
event.stopPropagation();
|
||||
|
||||
const onKeyPress = (event: React.KeyboardEvent<HTMLInputElement>) => {
|
||||
if (event.key === ENTER) {
|
||||
event.preventDefault();
|
||||
addValues();
|
||||
}
|
||||
};
|
||||
@ -91,7 +90,7 @@ export const FreeTextInput = ({
|
||||
<div className={styles.inputContainer}>
|
||||
<div className={styles.inputInnerContainer}>
|
||||
<Input
|
||||
onKeyDown={onKeyDown}
|
||||
onKeyPress={onKeyPress}
|
||||
label="Values"
|
||||
name="values"
|
||||
value={inputValues}
|
||||
|
Loading…
Reference in New Issue
Block a user