ui icon indicating copy to clipboard operation
ui copied to clipboard

DropdownMenu doesn't load default classes CSS

Open edwini opened this issue 2 years ago • 4 comments

Hi! in the <DropdownMenu /> component, CSS classes aren't load in the final <div> element. Captura de Pantalla 2023-02-19 a la(s) 22 45 10

As you can see I am using <DropdownMenuSeparator /> withour classes and the final div is empty, but if I add classes by my own, its loads only my custom classes. Captura de Pantalla 2023-02-19 a la(s) 22 49 11 Captura de Pantalla 2023-02-19 a la(s) 22 49 31

I added in lib folder the utils.ts file, but I dont undertand the why it is not working. This is happeding with all childs of <DropdownMenu />

Thank you.

edwini avatar Feb 20 '23 04:02 edwini

Hi! Are you importing the component and then adding the classes on the element? It worked for me so I'm not sure I'm understanding. If you had some code public I'd be willing to look at it.

What I did: Screenshot 2023-02-20 at 11 24 35 AM

Result: Screenshot 2023-02-20 at 11 21 11 AM

leabs avatar Feb 20 '23 16:02 leabs

@edwini If you're still having this issue, I had the same and found the reason.

Check your imports and make sure you're actually importing from the DropdownMenu.tsx you created and not the Radix UI.

Turns out VS Code was importing from the wrong place when I used the "fix this".

PatrickJoannisse avatar Apr 15 '23 19:04 PatrickJoannisse

@edwini If you're still having this issue, I had the same and found the reason.

Check your imports and make sure you're actually importing from the DropdownMenu.tsx you created and not the Radix UI.

Turns out VS Code was importing from the wrong place when I used the "fix this".

Worked for me too. thanks @PatrickJoannisse

sojinsamuel avatar Jan 14 '24 11:01 sojinsamuel

@edwini If you're still having this issue, I had the same and found the reason.

Check your imports and make sure you're actually importing from the DropdownMenu.tsx you created and not the Radix UI.

Turns out VS Code was importing from the wrong place when I used the "fix this".

image

That's it. Thanks @PatrickJoannisse

LucasJantschChitolina avatar Jan 21 '24 13:01 LucasJantschChitolina

that was the problem, thanks

edwini avatar Apr 15 '24 19:04 edwini

for me it was a parent div with a fixed position style, so i change it, and it works for me

shicham avatar Aug 08 '24 15:08 shicham