Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Menu will not allow text to break #1924

Closed
benhchoi opened this issue Jun 5, 2023 · 3 comments
Closed

bug: Menu will not allow text to break #1924

benhchoi opened this issue Jun 5, 2023 · 3 comments

Comments

@benhchoi
Copy link

benhchoi commented Jun 5, 2023

What version of daisyUI are you using?

v3.0.3

Describe your issue

I expect menu items to respect word breaks, but they don't. Instead, menu items will always overflow. This used to work before the upgrade from v2 to v3 (words would break according to break-normal by default without the need to even include the class, which in my opinion seems like the most logical default).

What browsers are you seeing the problem on?

Chrome

Reproduction URL (optional)

https://play.tailwindcss.com/TdBkm1eFoU

@saadeghi
Copy link
Owner

saadeghi commented Jun 7, 2023

The item inside <li> has grid-auto-columns: max-content auto max-content because it has to position other elements inside the menu item as well:

  • text
  • icon + text
  • icon + text + badge
  • text + badge

So the first item grows to the max width.

You can opt out of this behavior by adding auto-cols-auto to <a>. Or by using flex. See this example:
https://play.tailwindcss.com/9CD91Y3lx9

Let me know if you have any questions

@saadeghi saadeghi closed this as completed Jun 7, 2023
@benhchoi
Copy link
Author

benhchoi commented Jun 9, 2023

Gotcha, thanks for clarifying!

@ddadaal
Copy link

ddadaal commented Jun 18, 2023

But neither approaches (auto-cols-auto and flex) doesn't work for submenus.

https://play.tailwindcss.com/Sy4pCzcY2y

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants