Skip to content

Commit d3b73cb

Browse files
committed
fix: fix button position disappeared on new sidebar layout
closes #290
1 parent f5e810c commit d3b73cb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,15 @@ function main() {
2424
const container = getMenuContainer()
2525
injectionMap.set(nav, container)
2626

27-
const chatList = nav.querySelector(':scope > div.overflow-y-auto, :scope > div.overflow-y-hidden')
27+
const chatList = nav.querySelector(':scope > div.sticky.bottom-0')
2828
if (chatList) {
29-
chatList.after(container)
29+
chatList.prepend(container)
3030
}
3131
else {
3232
// fallback to the bottom of the nav
33+
container.style.backgroundColor = '#171717'
34+
container.style.position = 'sticky'
35+
container.style.bottom = '72px'
3336
nav.append(container)
3437
}
3538
}
@@ -95,7 +98,7 @@ function main() {
9598
function getMenuContainer() {
9699
const container = document.createElement('div')
97100
// to overlap on the list section
98-
container.style.zIndex = '20'
101+
container.style.zIndex = '99'
99102
render(<Menu container={container} />, container)
100103
return container
101104
}

0 commit comments

Comments
 (0)