Skip to content

Make accumulator into a form so hitting return in preview submits. #68

@rouilj

Description

@rouilj

In a form hitting return in a plaintext input triggers the submit function.
The searchFragment implements this. But the accumulator doesn't.

Wrap the accumulator input and buttons in a form so hitting return in the preview input
submits the changes.

diff --git a/html/classhelper.js b/html/classhelper.js
index 3ff630ef..44d98c17 100644
--- a/html/classhelper.js
+++ b/html/classhelper.js
@@ -728,8 +735,11 @@ class ClassHelper extends HTMLElement {
         const fragment = document.createDocumentFragment();
         const container = document.createElement("div");
         container.id = "popup-control";
-        container.classList.add("popup-control");
 
+        const form = document.createElement("form")
+        form.id = "accumulator-form"
+        form.classList.add("popup-control");
+      
         const preview = document.createElement("input");
         preview.id = "popup-preview";
         preview.classList.add("popup-preview");
@@ -761,7 +771,8 @@ class ClassHelper extends HTMLElement {
             }))
         })
 
-        container.append(preview, cancel, apply);
+      form.append(preview, cancel, apply);
+      container.append(form)
         fragment.appendChild(container);
 
         return fragment;

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions