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: long string in menu does not wrap in safari (with temp solution) #2862

Open
siraisisatoru opened this issue Feb 22, 2024 · 1 comment
Open

Comments

@siraisisatoru
Copy link

siraisisatoru commented Feb 22, 2024

What version of daisyUI are you using?

v4.7.2

Which browsers are you seeing the problem on?

Chrome iOS + Safari Mac

Reproduction URL

https://daisyui.com/components/menu/#submenu

Describe your issue

Hello.

I am sorry that I didn't found #2626 and opened this issue.

I am currently working on a personal project that uses navbar-with-icon-at-start-and-end and embed drawer to the left most menu element in Navbar. It was functional beautifully until I had one of the strings in element become too long and not auto wrapping on my page using iOS Chrome. Then I investigated a bit by trial and error with my page by adding w-52 (some other values that fit my design, applied to the outermost ul) to my menu element which I thought was meant to be not being wrapped as mentioned in #2182 which was an issue for dropdown element. The result remains the same with the long strong still making all elements expended and even over the edge of the drawer on iOS Chrome. In contrast, it works totally fine in Chrome on Mac. Then I guessed it maybe something related to iOS and thus I checked with other browsers and it seems it happened to Safari on Mac as well.

The picture below shows the problem I tried to describe above. (They all run the same code by accessing localhost at the same time)

Screenshot 2024-02-23 at 2 38 15 am

The story didn't end here. I further investigated the behaviour of the long element that caused the whole width using Safari inspector and I found there is white-space:nowrap from nowhere (I didn't set it manually).

Screenshot 2024-02-23 at 2 47 36 am Screenshot 2024-02-23 at 2 49 25 am

I guess it was somewhat other plugins messed it up locally. To prove this is my own issue, I tried to use Tailwind Play but it can not even load Daisyui on my end (Chrome and Safari on Mac).

Screenshot 2024-02-23 at 2 53 04 am

As I what to wrap my text in sub-sub-sub menu, I found submenu which is similar to my case and can reproduce my cause. (Upper is Safari on Mac and below is Chrome on Mac.)

Screenshot 2024-02-23 at 2 57 23 am Screenshot 2024-02-23 at 3 06 21 am

TL;DR

Issues:

  • Long text not wrapping in menu in browser
    • Not working in iOS Chrome and Mac Safari
    • Can be reproduced on the official page
  • menu class does not work in Tailwind play

Proposed solution
Add whitespace-normal to the li element to bring it back to normal.

Screenshot 2024-02-23 at 3 11 11 am

Thank you read through this long issue and hopefully we can have a clarification on the following.

  1. Which one is the intended behaviour?
  2. Which element is actually causing the issue? (maybe menu?)
  3. Any official solution for this besides my one?

Thank you all maintainers! I love daisyui!

Copy link

Thank you @siraisisatoru for reporting issues. It helps daisyUI a lot 💚
I'll be working on issues one by one. I will help with this one as soon as a I find a solution.
In the meantime providing more details and reproduction links would be helpful.

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

1 participant