material-tailwind icon indicating copy to clipboard operation
material-tailwind copied to clipboard

<Select /> stopped being created in the portal, therefore, <ul> is displayed below the label (wrong)

Open kvnzrch opened this issue 2 years ago • 5 comments

https://github.com/creativetimofficial/material-tailwind/assets/74398451/1c66bedb-9b1a-4834-ac46-0bdb2c1ab6f7

As the title says, this happens after the latest version

kvnzrch avatar Aug 24 '23 19:08 kvnzrch

no one has this same problem?

kvnzrch avatar Aug 30 '23 16:08 kvnzrch

It can be fixed, wrapping the menu with the portal of floating-ui...

On this file:

packages/material-tailwind-react/src/components/Select/index.tsx

Add

<>
+  <FloatingPortal>
      {lockScroll ? (
        <FloatingOverlay lockScroll>{selectMenu}</FloatingOverlay>
      ) : (
        selectMenu
      )}
+  </FloatingPortal>
</>

@sajadevo Can you do this? 🙏

kvnzrch avatar Sep 11 '23 23:09 kvnzrch

@kenzaflow adding floating portal will cause issue when using Select inside a dialog or other floating elements, so to fix that issue you can set the following: <Select menuProps={{ className: "z-50" }} />

sajadevo avatar Sep 14 '23 08:09 sajadevo

i have problem with select element. menuProps dosent work on select element. im add z index class to menu props but is dosent work correct???????!!!!!! any way to fix that please!!!!

Mortezakiaa avatar Oct 01 '23 07:10 Mortezakiaa

+1 same issue here

ziudeso avatar Jul 19 '24 10:07 ziudeso