Skip to content

Commit 3f20675

Browse files
authored
Limit width of user menu in space panel (matrix-org#11192)
Fixes: element-hq/element-web#22627
1 parent 8107f1d commit 3f20675

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

Diff for: res/css/structures/_SpacePanel.pcss

+1
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ limitations under the License.
370370
padding: 0 2px 8px;
371371
border-bottom: 1px solid $quinary-content;
372372
margin: 12px 14px 4px 18px;
373+
max-width: 226px;
373374
}
374375
}
375376

Diff for: res/css/structures/_UserMenu.pcss

+7
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,14 @@ limitations under the License.
4646
}
4747
}
4848

49+
.mx_UserMenu_contextMenuButton {
50+
width: 100%;
51+
}
52+
4953
.mx_UserMenu_name {
54+
overflow: hidden;
55+
text-overflow: ellipsis;
56+
white-space: nowrap;
5057
font-weight: var(--cpd-font-weight-semibold);
5158
font-size: $font-15px;
5259
line-height: $font-24px;

Diff for: src/components/structures/UserMenu.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ export default class UserMenu extends React.Component<IProps, IState> {
446446
return (
447447
<div className="mx_UserMenu">
448448
<ContextMenuButton
449+
className="mx_UserMenu_contextMenuButton"
449450
onClick={this.onOpenMenuClick}
450451
inputRef={this.buttonRef}
451452
label={_t("User menu")}

Diff for: test/components/structures/__snapshots__/UserMenu-test.tsx.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ exports[`<UserMenu> when rendered should render as expected 1`] = `
99
aria-expanded="false"
1010
aria-haspopup="true"
1111
aria-label="User menu"
12-
class="mx_AccessibleButton"
12+
class="mx_AccessibleButton mx_UserMenu_contextMenuButton"
1313
role="button"
1414
tabindex="0"
1515
title="User menu"

0 commit comments

Comments
 (0)