You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we use react-dot-dot-dot for facet text truncation. This has some downsides:
A dependency / bundle size: Not a big deal really, since we use it elsewhere (e.g., for card titles in MIT Open and OCW).
It doesn't seem to recalculate the truncation on window resize. (See screenshot below. Notice ... even though there's room for more text; the window was previously smaller, causing the truncation. You can see this in action at https://ocw.mit.edu/search, too.)
The HTML text is really truncated, not just visually. This affects screenreader labels.
<divclass="facet-label"><labelfor="department-15" class="facet-key"><div>Sloan School of Mana…</div></label><divclass="facet-count">215</div></div>
Plan/Design
IMO, it would be simpler to just use CSS text-overflow: ellipsis to truncate. That works well for single lines.
The text was updated successfully, but these errors were encountered:
Description/Context
Currently we use
react-dot-dot-dot
for facet text truncation. This has some downsides:...
even though there's room for more text; the window was previously smaller, causing the truncation. You can see this in action at https://ocw.mit.edu/search, too.)Plan/Design
IMO, it would be simpler to just use CSS
text-overflow: ellipsis
to truncate. That works well for single lines.The text was updated successfully, but these errors were encountered: