@setoelkahfi / svara / commits / e137f67

fixed dropdowns opening in the wrong location

mellbacon committed May 7, 2023 at 00:54 UTC e137f67d6310dd75299d101645cfb2b45e8b95dd
2 files changed +4 -9
src/App.svelte
+1 -7
@@ -67,9 +67,7 @@
67 {/if}
68 <Pane>
69 <div id="container">
70 - <div id="editor-view">
71 - <EditorTabList />
72 - </div>
70 + <EditorTabList />
71 </div>
72 </Pane>
73 </Splitpanes>
@@ -82,12 +80,8 @@
80 #container {
81 height: 100%;
82 overflow: hidden;
85 - }
86 - #editor-view {
83 background-image: url("/assets/images/Watermark(3).png");
84 background-repeat: no-repeat;
85 background-position: center;
90 - position: relative;
91 - height: 100%;
86 }
87 </style>
\ No newline at end of file
src/lib/utility/Dropdown.svelte
+3 -2
@@ -10,8 +10,9 @@
10
11 afterUpdate(() => {
12 if (open && dropdownList) {
13 - const { height , left, width } = button.getBoundingClientRect();
14 - dropdownList.style.top = `${height}px`;
13 + const { height , left, width, top } = button.getBoundingClientRect();
14 + console.log(top)
15 + dropdownList.style.top = `${height + top}px`;
16 if (right) {
17 dropdownList.style.right = `calc(100% - ${left + width}px`;
18 dropdownList.style.left = `auto`;