Category drop down not truncating ... for longer category names

AI-generated summary

The issue of category drop-down not truncating for longer category names was reported by Lilly. Arkshine provided a CSS solution using text-overflow: ellipsis, which worked for Lilly.

However, isaac questioned whether the issue occurred in safe mode and if it was related to the absence of bullets in the badge wrappers. Lilly confirmed the issue persisted in safe mode, and isaac suspected that the removal of bullets in the badge wrappers might be the cause.

After further testing, Lilly ruled out the possibility that components were causing the issue and isaac was able to replicate the problem.

Lilly clarified that the issue was posted in the UX category as it only affects the UI appearance. The issue has since been fixed by awesomerobot in a Discourse commit.

category drop down selector display property isn’t wrapping / truncating (…) on longer category names.

3 Likes

Without making width changes to keep the same visual, adding an ellipsis might be a solution here:

.name > .badge-wrapper .badge-category {
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

image

2 Likes

thanks, i was thinking of CSS’ing it but hadn’t even attempted yet. you saved me some time trying to figure it out! :slight_smile: nice work :clap:

2 Likes

@Lilly does this happen in safe mode? Looking at a longer category here on meta seems to display as expected!

2 Likes

i can confirm it is happening safe mode

@isaac - i added screenshot

1 Like

I did not check, but there is already CSS code, my bad.

However, it seems to select the category name with a bullet, and there is no bullet on Lilly’s Discourse.

On meta:

Lilly:

i remove my bullets in the badge wrappers. but your code worked fine.

i know there is a setting for category bullets but i like to have granular control over where bullets appear in different themes.

I think this is the cause of your issue, or at least having adverse effects. On the latest version of Discourse:


Did the dropdown options truncate before?

@isaac i’ve removed my badge wrapper hide code and also the ellipses code that @Arkshine provided and i am now running it in safe mode with admin-settings- category style set to none (no badges) and i still get the same issue as the safe-mode screenshot above. components shouldn’t make a difference in safe-mode anyways.

1 Like

Thanks @Lilly, yup, I can replicate the issue now! Thank you!

2 Likes

FWIW i posted this in UX instead of bug because it’s clearly not a functional or critical issue, and only affects UI appearance for the case of extra long category names (and as we’ve since discovered, no badge wrapper bullets).

This has been fixed here:

https://github.com/discourse/discourse/commit/9268bb92bdcc7d6ec62e5506112542d89e836069

2 Likes

@awesomerobot is awesome :star_struck: thanks!

2 Likes

This topic was automatically closed after 15 hours. New replies are no longer allowed.