@riotjs/dom-bindings
Advanced tools
Comparing version 9.1.0 to 9.2.0
@@ -13,2 +13,3 @@ import { insertBefore, removeChild, replaceChild, cleanNode, moveChildren, clearChildren } from '@riotjs/util/dom'; | ||
const TAIL_SYMBOL = Symbol(); | ||
const REF_ATTRIBUTE = 'ref'; | ||
@@ -574,2 +575,9 @@ /** | ||
// ref attributes are treated differently so we early return in this case | ||
if (name === REF_ATTRIBUTE) { | ||
node && node.removeAttribute(node, name); | ||
value(node); | ||
return | ||
} | ||
// store the attribute on the node to make it compatible with native custom elements | ||
@@ -741,2 +749,5 @@ if ( | ||
if (this.type === EVENT) apply(this, null); | ||
// ref attributes need to be unmounted as well | ||
if (this.name === REF_ATTRIBUTE) | ||
expressions[ATTRIBUTE](null, this, this.value); | ||
@@ -743,0 +754,0 @@ return this |
{ | ||
"name": "@riotjs/dom-bindings", | ||
"version": "9.1.0", | ||
"version": "9.2.0", | ||
"description": "Riot.js DOM bindings", | ||
@@ -5,0 +5,0 @@ "main": "dist/dom-bindings.cjs", |
export const HEAD_SYMBOL = Symbol() | ||
export const TAIL_SYMBOL = Symbol() | ||
export const REF_ATTRIBUTE = 'ref' |
@@ -1,4 +0,5 @@ | ||
import { EVENT, TEXT } from '@riotjs/util/expression-types' | ||
import { ATTRIBUTE, EVENT, TEXT } from '@riotjs/util/expression-types' | ||
import expressions from './expressions/index.js' | ||
import { getTextNode } from './expressions/text.js' | ||
import { REF_ATTRIBUTE } from './constants.js' | ||
@@ -49,2 +50,5 @@ export const Expression = { | ||
if (this.type === EVENT) apply(this, null) | ||
// ref attributes need to be unmounted as well | ||
if (this.name === REF_ATTRIBUTE) | ||
expressions[ATTRIBUTE](null, this, this.value) | ||
@@ -51,0 +55,0 @@ return this |
@@ -7,2 +7,3 @@ import { | ||
import { memoize } from '@riotjs/util/misc' | ||
import { REF_ATTRIBUTE } from '../constants.js' | ||
@@ -95,2 +96,9 @@ /* c8 ignore next */ | ||
// ref attributes are treated differently so we early return in this case | ||
if (name === REF_ATTRIBUTE) { | ||
node && node.removeAttribute(node, name) | ||
value(node) | ||
return | ||
} | ||
// store the attribute on the node to make it compatible with native custom elements | ||
@@ -97,0 +105,0 @@ if ( |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
156045
4013