Skip to content

regression: can not find element inside suspense if root element #1173

@cexbrayat

Description

@cexbrayat

After the refactoring released in rc.18, we stumbled into a regression when updating in our projects

Failing test:

  test('returns the element if it is a root element inside Suspense', () => {
    const Async = defineComponent({
      // works if there is a root element
      // template: '<div><h1>Hello</h1><span id="my-span">There</span></div>'
      // otherwise does not find the element
      template: '<h1>Hello</h1><span id="my-span">There</span>'
    })
    const Component = defineComponent({
      components: { Async },
      template: '<Suspense><Async/></Suspense>'
    })

    const wrapper = mount(Component)
    expect(wrapper.get('#my-span')).not.toBeNull()
  })

Repro in #1172

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions