Merge pull request #1408 from sveltejs/gh-1407

mark elements with refs as ineligible for innerhtml
pull/1414/head
Rich Harris 7 years ago committed by GitHub
commit ea95ae741e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -191,6 +191,10 @@ export default class Element extends Node {
block.outros += 1;
}
if (this.ref) {
this.parent.cannotUseInnerHTML();
}
const valueAttribute = this.attributes.find((attribute: Attribute) => attribute.name === 'value');
// special case — in a case like this...

@ -0,0 +1,7 @@
export default {
html: '<div><canvas></canvas></div>',
test ( assert, component, target ) {
const canvas = target.querySelector( 'canvas' );
assert.equal( canvas, component.refs.foo );
}
};

@ -0,0 +1 @@
<div><canvas ref:foo></canvas></div>
Loading…
Cancel
Save