Skip to content
Snippets Groups Projects
Verified Commit 0a97623a authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

fix: debouncing form handling

parent 8a9f20b2
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,7 @@ import {
ATTRIBUTE_UPDATER_BIND,
} from "../../dom/constants.mjs";
import {findTargetElementFromEvent} from "../../dom/events.mjs";
import {ID} from "../../types/id.mjs";
import {clone} from "../../util/clone.mjs";
import {DeadMansSwitch} from "../../util/deadmansswitch.mjs";
import {DataSet} from "../datatable/dataset.mjs";
......@@ -154,7 +155,8 @@ class Form extends DataSet {
}
}
function initDataSourceHandler() {}
function initDataSourceHandler() {
}
/**
* @private
......@@ -174,22 +176,14 @@ function initEventHandler() {
return;
}
let elementID = element.id;
if (elementID === "") {
elementID = element.getAttribute("name");
}
if (elementID === "") {
elementID = element.getAttribute("data-monster-attributes");
}
if (elementID === "") {
elementID = element.innerText.substring(0, 20);
let elementID
if (!element.hasAttribute("data-monster-debounce-id")) {
elementID = new ID('debounce').toString();
element.setAttribute("data-monster-debounce-id", elementID);
} else {
elementID = element.getAttribute("data-monster-debounce-id");
}
elementID = elementID.replace(/\s/g, "_")
if (this[debounceBindSymbol][elementID] instanceof DeadMansSwitch) {
try {
this[debounceBindSymbol][elementID].touch();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment