(null)
diff --git a/packages/@headlessui-vue/src/components/dialog/dialog.test.ts b/packages/@headlessui-vue/src/components/dialog/dialog.test.ts
index 3b76267f40..d2333ca77d 100644
--- a/packages/@headlessui-vue/src/components/dialog/dialog.test.ts
+++ b/packages/@headlessui-vue/src/components/dialog/dialog.test.ts
@@ -391,6 +391,57 @@ describe('Rendering', () => {
expect(document.documentElement.style.overflow).toBe('hidden')
})
)
+
+ it(
+ 'should wait to add a scroll lock to the html tag when unmount is false in a Transition',
+ suppressConsoleLogs(async () => {
+ renderTemplate({
+ components: {
+ Dialog,
+ TransitionRoot,
+ },
+
+ template: `
+
+
+
+
+
+
+
+ `,
+ setup() {
+ let isOpen = ref(false)
+ return {
+ isOpen,
+ setIsOpen(value: boolean) {
+ isOpen.value = value
+ },
+ toggleOpen() {
+ isOpen.value = !isOpen.value
+ },
+ }
+ },
+ })
+
+ // No overflow yet
+ expect(document.documentElement.style.overflow).toBe('')
+
+ let btn = document.getElementById('trigger')
+
+ // Open the dialog
+ await click(btn)
+
+ // Expect overflow
+ expect(document.documentElement.style.overflow).toBe('hidden')
+ })
+ )
})
describe('DialogOverlay', () => {