diff --git a/webapp/channels/src/components/sidebar/sidebar_channel/sidebar_channel_link/__snapshots__/sidebar_channel_link.test.tsx.snap b/webapp/channels/src/components/sidebar/sidebar_channel/sidebar_channel_link/__snapshots__/sidebar_channel_link.test.tsx.snap index 24903768e6..7a7a14821a 100644 --- a/webapp/channels/src/components/sidebar/sidebar_channel/sidebar_channel_link/__snapshots__/sidebar_channel_link.test.tsx.snap +++ b/webapp/channels/src/components/sidebar/sidebar_channel/sidebar_channel_link/__snapshots__/sidebar_channel_link.test.tsx.snap @@ -199,15 +199,11 @@ exports[`components/sidebar/sidebar_channel/sidebar_channel_link should match sn ] } > -
- - channel_label - -
+ channel_label + { labelRef: React.RefObject; - gmItemRef: React.RefObject; constructor(props: Props) { super(props); this.labelRef = React.createRef(); - this.gmItemRef = React.createRef(); this.state = { isMenuOpen: false, @@ -105,7 +103,7 @@ export default class SidebarChannelLink extends React.PureComponent { - const element = this.gmItemRef.current || this.labelRef.current; + const element = this.labelRef.current; const showTooltip = element && element.offsetWidth < element.scrollWidth; this.setState({showTooltip: Boolean(showTooltip)}); }; @@ -133,7 +131,7 @@ export default class SidebarChannelLink extends React.PureComponent this.gmItemRef.current?.removeAttribute?.('aria-describedby'); + removeTooltipLink = (): void => this.labelRef.current?.removeAttribute?.('aria-describedby'); handleChannelClick = (event: React.MouseEvent): void => { mark(Mark.ChannelLinkClicked); @@ -195,7 +193,10 @@ export default class SidebarChannelLink extends React.PureComponent + {wrapEmojis(label)} ); @@ -212,12 +213,7 @@ export default class SidebarChannelLink extends React.PureComponent -
- {labelElement} -
+ {labelElement} ); } @@ -231,7 +227,6 @@ export default class SidebarChannelLink extends React.PureComponent
{labelElement} {customStatus} diff --git a/webapp/channels/src/sass/layout/_sidebar-left.scss b/webapp/channels/src/sass/layout/_sidebar-left.scss index 12da7d9ba1..95835c4b34 100644 --- a/webapp/channels/src/sass/layout/_sidebar-left.scss +++ b/webapp/channels/src/sass/layout/_sidebar-left.scss @@ -1132,10 +1132,12 @@ $sidebarOpacityAnimationDuration: 0.15s; } & span.SidebarChannelLinkLabel { + overflow: hidden; max-width: 100%; height: 18px; line-height: 18px; text-align: justify; + text-overflow: ellipsis; user-select: none; white-space: nowrap; } @@ -1298,13 +1300,7 @@ $sidebarOpacityAnimationDuration: 0.15s; display: flex; overflow: hidden; flex-grow: 1; - } - - .SidebarChannelLinkLabel_wrapper > div.truncated { - display: block; - overflow: hidden; - width: 100%; - text-overflow: ellipsis; + gap: 8px; } .DirectChannel__profile-picture {