Skip to content

Commit f016dbd

Browse files
LanThuyNguyeniOvergaard
authored andcommitted
Fix issue text overflow when user name is too long
1 parent b2aa04a commit f016dbd

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

src/Umbraco.Web.UI.Client/src/less/components/users/umb-user-cards.less

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,16 @@
8989

9090

9191
.umb-user-card__name {
92-
font-size: 15px;
93-
font-weight: bold;
94-
text-align: center;
95-
margin-bottom: 2px;
96-
word-wrap: break-word;
92+
display: -webkit-box;
93+
-webkit-line-clamp: 2;
94+
-webkit-box-orient: vertical;
95+
overflow: hidden;
96+
text-overflow: ellipsis;
97+
font-size: 15px;
98+
font-weight: bold;
99+
text-align: center;
100+
margin-bottom: 2px;
101+
word-wrap: break-word;
97102
}
98103

99104
.umb-user-card__group {
@@ -107,3 +112,12 @@
107112
text-align: center;
108113
margin-top: auto;
109114
}
115+
116+
.umb-user-name__last-login {
117+
display: -webkit-box;
118+
-webkit-line-clamp: 2;
119+
-webkit-box-orient: vertical;
120+
overflow: hidden;
121+
text-overflow: ellipsis;
122+
word-wrap: break-word;
123+
}

src/Umbraco.Web.UI.Client/src/views/users/views/users/users.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
<umb-avatar size="l" color="secondary" name="{{user.name}}" img-src="{{user.avatars[2]}}" img-srcset="{{user.avatars[3]}} 2x, {{user.avatars[4]}} 3x">
197197
</umb-avatar>
198198
</div>
199-
<div class="umb-user-card__name">{{user.name}}</div>
199+
<div title="{{user.name}}" class="umb-user-card__name">{{user.name}}</div>
200200
</a>
201201
<div class="umb-user-card__group">
202202
<span ng-repeat="userGroup in user.userGroups">{{ userGroup.name }}<span ng-if="!$last">, </span></span>
@@ -209,9 +209,10 @@
209209
{{ user.formattedLastLogin }}
210210
</div>
211211
<div ng-if="!user.formattedLastLogin">
212-
<div>{{ user.name | umbWordLimit:1 }}
213-
<localize key="user_noLogin">has not logged in yet</localize>
214-
</div>
212+
<div class="umb-user-name__last-login" title="{{ user.name | umbWordLimit:1 }}">
213+
{{ user.name | umbWordLimit:1 }}
214+
</div>
215+
<localize key="user_noLogin">has not logged in yet</localize>
215216
</div>
216217
</div>
217218
</div>

0 commit comments

Comments
 (0)