mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 03:26:36 +00:00
fix(ComposedModal): don't submit on enter if event target is a button
This commit is contained in:
parent
69cb412c34
commit
ac6d1fe8c1
1 changed files with 3 additions and 0 deletions
|
@ -113,6 +113,9 @@
|
||||||
if (key === 'Escape') {
|
if (key === 'Escape') {
|
||||||
open = false;
|
open = false;
|
||||||
} else if (shouldSubmitOnEnter && key === 'Enter') {
|
} else if (shouldSubmitOnEnter && key === 'Enter') {
|
||||||
|
if(e.target.tagName == 'BUTTON') {
|
||||||
|
return
|
||||||
|
}
|
||||||
dispatch('submit', e.target);
|
dispatch('submit', e.target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue