File tree Expand file tree Collapse file tree 1 file changed +8
-15
lines changed
packages/client/src/components/common Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,6 @@ const sidebarScrollable = computed(() => devtoolsClientState.value.scrollableSid
12
12
const { enabledTabs, flattenedTabs } = useAllTabs ()
13
13
14
14
const ITEM_HEIGHT = 45
15
- const INIT_DISTANCE = 6
16
- const DIF_DISTANCE = 200
17
15
18
16
const { height : windowHeight } = useWindowSize ()
19
17
const containerCapacity = computed (() => {
@@ -44,31 +42,26 @@ onClickOutside(
44
42
{ detectIframe: true },
45
43
)
46
44
47
- const distance = ref ( INIT_DISTANCE )
45
+ const containerRef = ref < HTMLDivElement >( )
48
46
49
- watch (
50
- () => devtoolsClientState .value .expandSidebar ,
51
- (expandSidebar ) => {
52
- if (expandSidebar ) {
53
- distance .value = DIF_DISTANCE + INIT_DISTANCE
54
- }
55
- else {
56
- distance .value = INIT_DISTANCE - DIF_DISTANCE
57
- }
58
- },
47
+ const dropdownDistance = ref (6 )
59
48
60
- )
49
+ useResizeObserver (containerRef , () => {
50
+ // This is a hack to force the dropdown to reposition itself
51
+ dropdownDistance .value = dropdownDistance .value === 6 ? 6.01 : 6
52
+ })
61
53
</script >
62
54
63
55
<template >
64
56
<div
57
+ ref =" containerRef"
65
58
border =" r base" flex =" ~ col items-start"
66
59
class =" $ui-z-max-override" h-full of-hidden bg-base
67
60
>
68
61
<div
69
62
sticky top-0 z-1 w-full p1 bg-base border =" b base"
70
63
>
71
- <VueDropdown placement =" left-start" :distance :skidding =" 5" trigger =" click" :shown =" showDocking" class =" w-full" >
64
+ <VueDropdown placement =" left-start" :distance = " dropdownDistance " :skidding =" 5" trigger =" click" :shown =" showDocking" class =" w-full" >
72
65
<button
73
66
ref =" buttonDocking"
74
67
flex =" ~ items-center justify-center gap-2"
You can’t perform that action at this time.
0 commit comments