Fix bug bypassing verification in confirmation modal when pressing Enter (#6889)

# Description
Fix bug bypassing verification in the confirmation modal when pressing
Enter

# Demo
Tested for webhook case (similar to other cases):
1. Press Enter when invalid verification => not delete webhook
2. Press Enter when valid verification => delete webhook


https://github.com/user-attachments/assets/81aa0aaa-7361-4584-b7ae-b29525f33664

# Ref
Fixes #6663
This commit is contained in:
Lý Thanh Bách 2024-09-04 20:15:29 +07:00 committed by GitHub
parent dbcbe754dd
commit 7a282b4363
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -93,7 +93,7 @@ export const ConfirmationModal = ({
setIsOpen(false);
}
}}
onEnter={onConfirmClick}
onEnter={!isValidValue ? undefined : onConfirmClick}
isClosable={true}
padding="large"
>