Skip to content

Commit c0634e9

Browse files
fix: navigation on mobile v8
1 parent 4bd50b0 commit c0634e9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

custom-implementation/src/main.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ const render = async () => {
1818

1919
const data = await getPageData()
2020
const theme = document.getElementsByTagName('html')[0].getAttribute('class')
21+
const sidenav = document.querySelector('button.fern-search-bar')
22+
?.parentElement as HTMLElement
2123

2224
if (!document.getElementById('theme-switch')) {
23-
const sidenav = document.querySelector('button.fern-search-bar')
24-
?.parentElement as HTMLElement
25-
2625
const wrapper = document.createElement('div')
2726
wrapper.setAttribute('id', 'theme-switch')
2827
sidenav.appendChild(wrapper)

0 commit comments

Comments
 (0)