Skip to content

Commit

Permalink
fix(lib): fix valyrian.js not updating the v- handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
Masquerade-Circus committed Jul 30, 2021
1 parent 8bb29e7 commit 1a52654
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,11 @@ function valyrian(): Valyrian {
return directives[prop](newVnode.props[prop], newVnode, oldVnode);
}
} else if (typeof newVnode.props[prop] === "function") {
if (newVnode.dom[`v-${prop}`] === undefined) {
if (attachedListeners.indexOf(prop) === -1) {
(mainContainer as DomElement).addEventListener(prop.slice(2), eventListener);
attachedListeners.push(prop);
}

newVnode.dom[`v-${prop}`] = newVnode.props[prop];
if (newVnode.dom[`v-${prop}`] === undefined && attachedListeners.indexOf(prop) === -1) {
(mainContainer as DomElement).addEventListener(prop.slice(2), eventListener);
attachedListeners.push(prop);
}
newVnode.dom[`v-${prop}`] = newVnode.props[prop];
} else if (prop in newVnode.dom && !newVnode.isSVG) {
// eslint-disable-next-line eqeqeq
if (newVnode.dom[prop] != newVnode.props[prop]) {
Expand Down

0 comments on commit 1a52654

Please sign in to comment.