fix(modal): prevent submit event on Modal if primaryButtonDisabled is true (#1486)

Fixes #1485
This commit is contained in:
Tadeáš Maršík 2022-09-17 19:30:33 +02:00 committed by GitHub
commit ec039ba163
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -168,7 +168,11 @@
tabbable[index].focus(); tabbable[index].focus();
e.preventDefault(); e.preventDefault();
} else if (shouldSubmitOnEnter && e.key === 'Enter') { } else if (
shouldSubmitOnEnter &&
e.key === 'Enter' &&
!primaryButtonDisabled
) {
dispatch('submit'); dispatch('submit');
dispatch('click:button--primary'); dispatch('click:button--primary');
} }