mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
fix(modal): prevent submit
event on Modal
if primaryButtonDisabled
is true (#1486)
Fixes #1485
This commit is contained in:
parent
bab5007807
commit
ec039ba163
1 changed files with 5 additions and 1 deletions
|
@ -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');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue