1
0
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:
Thomas Heartman 2025-04-24 12:19:03 +02:00 committed by GitHub
parent 3bb54c5a9d
commit f6eb572a14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);
}