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

fix: bind this to callback and fix timing #158 #164

parent 9f6d5f8a
Branches
Tags
No related merge requests found
......@@ -290,8 +290,9 @@ function getControlEventHandler() {
if (element === undefined) {
return;
}
retrieveAndSetValue.call(this, element);
setTimeout(() => {
retrieveAndSetValue.call(this, element)
}, 0);
};
return this[symbol];
......@@ -305,6 +306,7 @@ function getControlEventHandler() {
* @private
*/
function retrieveAndSetValue(element) {
const pathfinder = new Pathfinder(this[internalSymbol].subject.getSubject());
let path = element.getAttribute(ATTRIBUTE_UPDATER_BIND);
......@@ -936,7 +938,7 @@ function addObjectWithUpdaterToElement(elements, symbol, object) {
const cb = this?.[updaterTransformerMethodsSymbol]
if (this instanceof HTMLElement && (typeof cb === "function")) {
let callbacks = cb();
let callbacks = cb.call(this);
if (typeof callbacks === "object") {
for (const [name, callback] of Object.entries(callbacks)) {
if (typeof callback === "function") {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment