Home > OS >  Hide dropdown menu with overflow:hidden
Hide dropdown menu with overflow:hidden

Time:09-25

https://codesandbox.io/s/competent-hill-lszyv?file=/src/App.tsx

I'm trying to hide the dropdown menu (the red box) by setting the parent container with overflow:hidden but that doesn't work, how can I achieve this?

CodePudding user response:

Can hide it depend on open flag.

  {open && <ul className={styles.dropDownList}>
    {localesArr.map((locale, index) => {
      return (
        <li key={`${locale}-${index}`}>
          <a href="/">{locale}</a>
        </li>
      );
    })}

CodePudding user response:

I fixed by setting the container div to position:relative

  • Related