Skip to content

Commit 808c48a

Browse files
authored
adding overflow story and handles close icon (#540)
1 parent 00a5b3c commit 808c48a

File tree

3 files changed

+66
-43
lines changed

3 files changed

+66
-43
lines changed

packages/mgt/src/components/mgt-people-picker/mgt-people-picker.scss

Lines changed: 51 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -117,56 +117,64 @@ mgt-people-picker .people-selected-list {
117117
overflow: hidden;
118118
}
119119

120-
.overflow-gradient,
121-
mgt-people-picker .overflow-gradient {
122-
content: '';
123-
position: absolute;
124-
width: 15px;
125-
height: 90%;
126-
top: 0;
127-
right: 22px;
128-
background-image: linear-gradient(
129-
to right,
130-
rgba(255, 255, 255, 0) 0%,
131-
rgba(255, 255, 255, 0) 60%,
132-
$selected-person-background-color 100%
133-
);
134-
background-image: -moz-linear-gradient(
135-
left,
136-
rgba(255, 255, 255, 0) 0%,
137-
rgba(255, 255, 255, 0) 60%,
138-
$selected-person-background-color 100%
139-
);
140-
background-image: -o-linear-gradient(
141-
left,
142-
rgba(255, 255, 255, 0) 0%,
143-
rgba(255, 255, 255, 0) 60%,
144-
$selected-person-background-color 100%
145-
);
146-
background-image: -ms-linear-gradient(
147-
left,
148-
rgba(255, 255, 255, 0) 0%,
149-
rgba(255, 255, 255, 0) 60%,
150-
$selected-person-background-color 100%
151-
);
152-
background-image: -webkit-linear-gradient(
153-
left,
154-
rgba(255, 255, 255, 0) 0%,
155-
rgba(255, 255, 255, 0) 60%,
156-
$selected-person-background-color 100%
157-
);
120+
.overflow-offset,
121+
mgt-people-picker .overflow-offset {
122+
margin-left: 25px;
123+
.overflow-gradient {
124+
content: '';
125+
position: absolute;
126+
margin-right: 23px;
127+
width: 10px;
128+
height: 90%;
129+
top: 0;
130+
right: 0;
131+
background-image: linear-gradient(
132+
to right,
133+
rgba(255, 255, 255, 0) 0%,
134+
rgba(255, 255, 255, 0) 60%,
135+
$selected-person-background-color 100%
136+
);
137+
background-image: -moz-linear-gradient(
138+
left,
139+
rgba(255, 255, 255, 0) 0%,
140+
rgba(255, 255, 255, 0) 60%,
141+
$selected-person-background-color 100%
142+
);
143+
background-image: -o-linear-gradient(
144+
left,
145+
rgba(255, 255, 255, 0) 0%,
146+
rgba(255, 255, 255, 0) 60%,
147+
$selected-person-background-color 100%
148+
);
149+
background-image: -ms-linear-gradient(
150+
left,
151+
rgba(255, 255, 255, 0) 0%,
152+
rgba(255, 255, 255, 0) 60%,
153+
$selected-person-background-color 100%
154+
);
155+
background-image: -webkit-linear-gradient(
156+
left,
157+
rgba(255, 255, 255, 0) 0%,
158+
rgba(255, 255, 255, 0) 60%,
159+
$selected-person-background-color 100%
160+
);
161+
}
158162
}
159163

160164
.CloseIcon,
161165
mgt-people-picker .CloseIcon {
166+
height: 100%;
167+
top: 0;
168+
margin-top: 4px;
169+
margin-left: 10px;
170+
position: absolute;
162171
line-height: normal;
163172
font-family: 'FabricMDL2Icons';
164-
padding-right: 8px;
165-
margin-top: 0px;
173+
padding-right: 7px;
166174
cursor: pointer;
167175
color: $font-color;
168176
background-color: $selected-person-background-color;
169-
right: 0px;
177+
right: 0;
170178
}
171179

172180
:host .people-person,
@@ -273,6 +281,8 @@ mgt-person {
273281
cursor: default;
274282
}
275283
.selected-person {
284+
overflow: hidden;
285+
min-width: 100%;
276286
--avatar-size-s: 24px;
277287
margin-left: 0px;
278288
--color: $font-color;

packages/mgt/src/components/mgt-people-picker/mgt-people-picker.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,10 @@ export class MgtPeoplePicker extends MgtTemplatedComponent {
441441
${this.renderTemplate('selected-person', { person }, `selected-${person.id}`) ||
442442
this.renderSelectedPerson(person)}
443443
444-
<div class="overflow-gradient"></div>
445-
<div class="CloseIcon" @click="${e => this.removePerson(person, e)}">\uE711</div>
444+
<div class="overflow-offset">
445+
<div class="overflow-gradient"></div>
446+
<div class="CloseIcon" @click="${e => this.removePerson(person, e)}">\uE711</div>
447+
</div>
446448
</div>
447449
`
448450
)}

stories/components/peoplePicker.stories.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,14 @@ export const pickDistributionGroups = () => html`
6464
<mgt-people-picker type="group" group-type="distribution"></mgt-people-picker>
6565
<!-- group-type can be "any", "unified", "security", "mailenabledsecurity", "distribution" -->
6666
`;
67+
68+
export const pickerOverflowGradient = () => html`
69+
<mgt-people-picker
70+
default-selected-user-ids="e8a02cc7-df4d-4778-956d-784cc9506e5a,eeMcKFN0P0aANVSXFM_xFQ==,48d31887-5fad-4d73-a9f5-3c356e68a038,e3d0513b-449e-4198-ba6f-bd97ae7cae85"
71+
></mgt-people-picker>
72+
<style>
73+
.story-mgt-preview-wrapper {
74+
width: 120px;
75+
}
76+
</style>
77+
`;

0 commit comments

Comments
 (0)