We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b50fec3 commit 06b262dCopy full SHA for 06b262d
packages/forms/src/components/WebForms.astro
@@ -38,9 +38,12 @@ const clientScript = Astro.locals.forms.scriptToRun;
38
}
39
40
window.__enterToSubmit = function (event) {
41
- if (event.code === 'Enter') {
+ const target = event.target as HTMLElement;
42
+ const isMultiLine = target instanceof HTMLTextAreaElement;
43
+
44
+ if ((isMultiLine && event.ctrlKey || !isMultiLine) && event.code === 'Enter') {
45
event.preventDefault();
- document.getElementById((event.target as HTMLElement).getAttribute('data-submit')!)?.click();
46
+ document.getElementById(target.getAttribute('data-submit')!)?.click();
47
48
};
49
0 commit comments