When connecting an input element I wrap the tag in a span and this causes the input element to be attached again in an infinite loop.
A temporary fix to this that I did was to change the code around this line:
with the following code:
if (!Behavior || (this.ownerElement._attached || []).includes(name))
return;
const behavior = new Behavior(this.ownerElement);
if (!this.ownerElement._attached) {
this.ownerElement._attached = []
}
this.ownerElement._attached.push(name)
Maybe there is a better solution? I don't know. But it works for now.
It is interesting to note that the version used in the code pen example in the docs doesn't have this behavior. It only occurs in the latest version.
When connecting an
inputelement I wrap the tag in aspanand this causes theinputelement to be attached again in an infinite loop.A temporary fix to this that I did was to change the code around this line:
element-behaviors/src/index.ts
Line 183 in fb9f2aa
with the following code:
Maybe there is a better solution? I don't know. But it works for now.
It is interesting to note that the version used in the code pen example in the docs doesn't have this behavior. It only occurs in the latest version.