# Long category names

**URL:** https://meta.discourse.org/t/long-category-names/165092
**Category:** UX
**Created:** [September 23, 2020, 3:05pm UTC](https://meta.discourse.org/t/long-category-names/165092 "2020-09-23T15:05:52Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![mentalstring](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mentalstring/32/168934_2.png) [@mentalstring](https://meta.discourse.org/u/mentalstring)
#### Post date: [September 23, 2020, 3:05pm UTC](https://meta.discourse.org/t/long-category-names/165092/1 "2020-09-23T15:05:52Z")

</div>

We happen to have specially verbose category names which revealed this:

 ![Screenshot 2020-09-23 at 16.01.45](https://global.discourse-cdn.com/meta/original/3X/e/1/e1a743b7b90d52323077fb56008d63093a29fa3a.png)

Maybe a max-width on that element? I would say it’s acceptable if the name is cropped since the full name can be seen by opening the dropdown.

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [September 23, 2020, 3:38pm UTC](https://meta.discourse.org/t/long-category-names/165092/2 "2020-09-23T15:38:56Z")

</div>

Hello Paulo,

I think it should be truncated by default. Do you use any custom css?

Edit: Yes this is in the css by default. Check your css and add this if missing.

```
.badge-wrapper .badge-category .category-name {
    text-overflow: ellipsis;
    overflow: hidden;
}

```

---

<div class="post-metadata">

### Author: ![mentalstring](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mentalstring/32/168934_2.png) [@mentalstring](https://meta.discourse.org/u/mentalstring)
#### Post date: [September 23, 2020, 3:50pm UTC](https://meta.discourse.org/t/long-category-names/165092/3 "2020-09-23T15:50:16Z")

</div>

We do have some custom CSS, but it’s pretty basic and shouldn’t affect this. Nonetheless, I disabled our custom theme using safe-mode and got the same problem.

After some more tests, I noticed that this only gets triggered depending on the available space. Changing the available viewport width, it works fine:

 ![image](https://global.discourse-cdn.com/meta/original/3X/4/a/4aa4be2c7f7e22be170a708a48ca6c6c4eac9e4d.png)

Or, if tags are enabled in Discourse, it’s also fine:

 ![Screenshot 2020-09-23 at 16.42.53](https://global.discourse-cdn.com/meta/original/3X/5/a/5a7db4e0d1e98448286bc1ccdea4a2a873693b86.png)

But, if there’s a wide space for the category field (and if tags are not enabled), then it can overlap the preview.

---

<div class="post-metadata">

### Author: ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)
#### Post date: [September 23, 2020, 4:39pm UTC](https://meta.discourse.org/t/long-category-names/165092/4 "2020-09-23T16:39:54Z")

</div>

I see what you mean and can repro this if delete or overwrite the `max-width: 100%;` in this line:

```
#reply-control .category-input .category-chooser {
    display: flex;
    flex: 1 0 auto;
    max-width: 100%;
    width: auto;
}

```

Otherwise this truncate the category name with `...` at the end.

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [September 23, 2020, 10:30pm UTC](https://meta.discourse.org/t/long-category-names/165092/5 "2020-09-23T22:30:41Z")

</div>

I think I fixed this within the past month… have you updated Discourse recently?

---

<div class="post-metadata">

### Author: ![mentalstring](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mentalstring/32/168934_2.png) [@mentalstring](https://meta.discourse.org/u/mentalstring)
#### Post date: [September 24, 2020, 10:53am UTC](https://meta.discourse.org/t/long-category-names/165092/6 "2020-09-24T10:53:42Z")

</div>

My apologies, I should have checked tests-passed for this before reporting. You are right, this seems to be only present on the latest stable version so this can be closed.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [September 25, 2020, 1:03am UTC](https://meta.discourse.org/t/long-category-names/165092/7 "2020-09-25T01:03:28Z")

</div>


