Skip to content
Discussion options

You must be logged in to vote

I have done a self-made solution

basically with

function handleOutsideClick(e: MouseEvent) {
    const drawerEl = document.querySelector('#sidebar')
    const navList = document.querySelector('#navigation-list') // my nav list
    const navFooter = document.querySelector('#navigation-footer') // my nav footer items

    if (!drawerEl) return

    // navList and navFooter elements are ignored, they are inside DrawerEl, but if they are clicked, some other things should happen
    if ((navList && navList.contains(e.target as Node)) || (navFooter && navFooter.contains(e.target as Node))) return

    updateMiniSidebar(!drawerEl.contains(e.target as Node))
  }
  onMounted(() => {
    document.a…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@skoenfaelt
Comment options

Answer selected by skoenfaelt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant