diff --git a/src/compile/nodes/Element.ts b/src/compile/nodes/Element.ts index bb7d71fcd7..2dc46c69ad 100644 --- a/src/compile/nodes/Element.ts +++ b/src/compile/nodes/Element.ts @@ -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... diff --git a/test/runtime/samples/refs-no-innerhtml/_config.js b/test/runtime/samples/refs-no-innerhtml/_config.js new file mode 100644 index 0000000000..a1e5ddd7f1 --- /dev/null +++ b/test/runtime/samples/refs-no-innerhtml/_config.js @@ -0,0 +1,7 @@ +export default { + html: '
', + test ( assert, component, target ) { + const canvas = target.querySelector( 'canvas' ); + assert.equal( canvas, component.refs.foo ); + } +}; diff --git a/test/runtime/samples/refs-no-innerhtml/main.html b/test/runtime/samples/refs-no-innerhtml/main.html new file mode 100644 index 0000000000..35d9d3a54b --- /dev/null +++ b/test/runtime/samples/refs-no-innerhtml/main.html @@ -0,0 +1 @@ +