update for duplicative entry (#6356)

This commit is contained in:
james-ha-bruno
2025-12-09 01:47:10 -05:00
committed by GitHub
parent 9b9534c1eb
commit 599636d56b

View File

@@ -88,7 +88,9 @@ const Modal = ({
return closeModal({ type: 'esc' });
}
case ENTER_KEY_CODE: {
if (!shiftKey && !ctrlKey && !altKey && !metaKey && handleConfirm) {
// Skip if a submit button is focused - let native button click handle it to avoid double-fire
const isSubmitButton = event.target?.type === 'submit';
if (!shiftKey && !ctrlKey && !altKey && !metaKey && handleConfirm && !isSubmitButton) {
return handleConfirm();
}
}