mirror of
https://github.com/Unleash/unleash.git
synced 2025-05-12 01:17:04 +02:00
Prevent legal value selection from triggering form submit (#9831)
Use event.preventDefault to prevent the app from trying to submit the legal values (or the strategy) form when you hit "enter" in the legal values filter input.
This commit is contained in:
parent
3bb54c5a9d
commit
f6eb572a14
@ -159,6 +159,7 @@ export const RestrictiveLegalValues = ({
|
||||
|
||||
const handleSearchKeyDown = (event: React.KeyboardEvent) => {
|
||||
if (event.key === 'Enter' && filteredValues.length > 0) {
|
||||
event.preventDefault();
|
||||
const firstValue = filteredValues[0].value;
|
||||
onChange(firstValue);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user