Commit f3c70aa
authored
Fix Dialog usage in Tabs (#1149)
* only record the restoreElement once enabled
Currently we are collecting the `restoreElement` even if the focus trap
is not enabled. When we unmount we try to restore it.
The problem is the moment you unmount you want to restore but only if
the focus trap was enabled.
Another issue is that the dialog state will be `closed` before we get to
the `onUmount` hook. So there is probably a cleaner way to fix this, but
this does the trick as well where we only record the restoreElement the
moment the focus trap gets enabled.
* update changelog1 parent 26670d2 commit f3c70aa
File tree
2 files changed
+2
-3
lines changed- packages/@headlessui-vue/src/hooks
2 files changed
+2
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
| 21 | + | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
| |||
0 commit comments