fix(ComposedModal): don't submit on enter if event target is a button

This commit is contained in:
weaseldotro 2021-03-21 10:56:30 +02:00 committed by GitHub
commit ac6d1fe8c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -113,6 +113,9 @@
if (key === 'Escape') {
open = false;
} else if (shouldSubmitOnEnter && key === 'Enter') {
if(e.target.tagName == 'BUTTON') {
return
}
dispatch('submit', e.target);
}
}