diff --git a/src/compile/dom/index.ts b/src/compile/dom/index.ts index dc47f76392..f8fa646ccf 100644 --- a/src/compile/dom/index.ts +++ b/src/compile/dom/index.ts @@ -182,7 +182,7 @@ export default function dom( })} ${compiler.bindingGroups.length && `this._bindingGroups = [${Array(compiler.bindingGroups.length).fill('[]').join(', ')}];`} - this._intro = ${compiler.options.skipIntroByDefault ? 'options.intro' : 'true'}; + this._intro = ${compiler.options.skipIntroByDefault ? '!!options.intro' : 'true'}; ${templateProperties.onstate && `this._handlers.state = [%onstate];`} ${templateProperties.onupdate && `this._handlers.update = [%onupdate];`} diff --git a/src/compile/nodes/Element.ts b/src/compile/nodes/Element.ts index c897ca3b2c..34203d5c63 100644 --- a/src/compile/nodes/Element.ts +++ b/src/compile/nodes/Element.ts @@ -700,7 +700,7 @@ export default class Element extends Node { const fn = `%transitions-${intro.name}`; - block.builders.intro.addConditional(`#component._intro`, deindent` + block.builders.intro.addConditional(`#component.root._intro`, deindent` if (${name}) ${name}.invalidate(); #component.root._aftercreate.push(() => { @@ -735,7 +735,7 @@ export default class Element extends Node { `); } - block.builders.intro.addConditional(`#component._intro`, deindent` + block.builders.intro.addConditional(`#component.root._intro`, deindent` #component.root._aftercreate.push(() => { ${introName} = @wrapTransition(#component, ${this.var}, ${fn}, ${snippet}, true); ${introName}.run(1); diff --git a/test/runtime/samples/transition-js-intro-skipped-by-default-nested/Widget.html b/test/runtime/samples/transition-js-intro-skipped-by-default-nested/Widget.html new file mode 100644 index 0000000000..16ced20bc3 --- /dev/null +++ b/test/runtime/samples/transition-js-intro-skipped-by-default-nested/Widget.html @@ -0,0 +1,16 @@ +
+ + \ No newline at end of file diff --git a/test/runtime/samples/transition-js-intro-skipped-by-default-nested/_config.js b/test/runtime/samples/transition-js-intro-skipped-by-default-nested/_config.js new file mode 100644 index 0000000000..9e63e6c8f7 --- /dev/null +++ b/test/runtime/samples/transition-js-intro-skipped-by-default-nested/_config.js @@ -0,0 +1,11 @@ +export default { + skipIntroByDefault: true, + + test(assert, component, target, window, raf) { + const div = target.querySelector('div'); + assert.equal(div.foo, undefined); + + raf.tick(50); + assert.equal(div.foo, undefined); + }, +}; diff --git a/test/runtime/samples/transition-js-intro-skipped-by-default-nested/main.html b/test/runtime/samples/transition-js-intro-skipped-by-default-nested/main.html new file mode 100644 index 0000000000..fca2ea7607 --- /dev/null +++ b/test/runtime/samples/transition-js-intro-skipped-by-default-nested/main.html @@ -0,0 +1,9 @@ + + + \ No newline at end of file