Skip to content

Commit 38e4e35

Browse files
committed
[person] adding right bounds check and subsequent translate to person-card
1 parent a643044 commit 38e4e35

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/components/mgt-person/mgt-person.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,15 @@ export class MgtPerson extends MgtTemplatedComponent {
355355
customStyle = `bottom: ${personSize / 2 + 8}px`;
356356
}
357357

358+
// right edge vs width of person-card
359+
let rightSpace = rightEdge - 340;
360+
361+
// determines if there is space to render on right side
362+
if (rightSpace < 0 && (window.innerWidth || document.documentElement.clientWidth) > 340) {
363+
rightSpace = rightEdge - 340;
364+
customStyle = customStyle + `; transform: translate(${rightSpace}px)`;
365+
}
366+
358367
const flyoutClasses = {
359368
flyout: true,
360369
openLeft: this._openLeft,

0 commit comments

Comments
 (0)