diff --git a/src/generators/dom/preprocess.js b/src/generators/dom/preprocess.js index 8661dbb0fb85..6e6c33eafffc 100644 --- a/src/generators/dom/preprocess.js +++ b/src/generators/dom/preprocess.js @@ -264,7 +264,7 @@ function preprocessChildren ( generator, block, state, node, isTopLevel ) { if ( lastChild ) { lastChild.next = child; - lastChild.needsAnchor = !child._state.name; + lastChild.needsAnchor = !child._state || !child._state.name; } lastChild = child; diff --git a/test/runtime/samples/component-yield-follows-element/Foo.html b/test/runtime/samples/component-yield-follows-element/Foo.html new file mode 100644 index 000000000000..1e619f2ecdb0 --- /dev/null +++ b/test/runtime/samples/component-yield-follows-element/Foo.html @@ -0,0 +1,2 @@ +
before
+{{yield}} \ No newline at end of file diff --git a/test/runtime/samples/component-yield-follows-element/_config.js b/test/runtime/samples/component-yield-follows-element/_config.js new file mode 100644 index 000000000000..93703c7dab79 --- /dev/null +++ b/test/runtime/samples/component-yield-follows-element/_config.js @@ -0,0 +1,6 @@ +export default { + html: ` +
before
+ test + ` +}; diff --git a/test/runtime/samples/component-yield-follows-element/main.html b/test/runtime/samples/component-yield-follows-element/main.html new file mode 100644 index 000000000000..15747d9d53ab --- /dev/null +++ b/test/runtime/samples/component-yield-follows-element/main.html @@ -0,0 +1,11 @@ +test + +