After modifying the jQuery UI MultiSelect Widget to display all selected labels, I encountered an issue where too many elements would cause the text to be trimmed and ellipsed. My solution involved the following CSS:
.ui-multiselect .selected-text {
display: block;
max-width: 190px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
The only drawback of this approach is having to set display: block
on the element (span). This was necessary because without it, the width parameter was ignored and the span expanded to fit the entire text length.
I'm curious if it's possible to achieve the ellipsis effect with inline elements, avoiding the need to change display
to block
. If so, how can this be accomplished?