[Answered ]-Truncate items in dropdrown menu and selected item using javascript or jquery

1👍

Use the angular filter ‘limitTo’ to truncate the strings. See this

1👍

You actually don’t need javascript. You can use text-overflow: ellipsis along with overflow: hidden on any block level element with a width set. It will truncate any text that won’t fit within the width and add … For example:

.dropdown-menu li a {
    display: block;
    width: 150px;/* this can be any width you want */
    text-overflow: ellipsis;
    overflow: hidden;
}

Leave a comment