Skip to content

Commit ae49332

Browse files
authored
fix: render person-card inside parent container (#3324)
1 parent a8f4099 commit ae49332

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,7 @@ export class MgtPersonCard extends MgtTemplatedTaskComponent implements IHistory
529529

530530
if (this._windowHeight < 250) {
531531
this._smallView = true;
532+
this.fireCustomEvent('smallView', null, true);
532533
}
533534
const tabLocker = this.lockTabNavigation
534535
? html`<div @keydown=${this.handleEndOfCard} aria-label=${this.strings.endOfCard} tabindex="0" id="end-of-container"></div>`

packages/mgt-components/src/components/sub-components/mgt-flyout/mgt-flyout.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,13 @@ export class MgtFlyout extends MgtBaseTaskComponent {
134134
this.updateFlyout();
135135
});
136136
});
137+
138+
// handling when person-card is rendered in a smaller window
139+
this.addEventListener('smallView', () => {
140+
window.requestAnimationFrame(() => {
141+
this.updateFlyout();
142+
});
143+
});
137144
}
138145

139146
/**
@@ -372,7 +379,7 @@ export class MgtFlyout extends MgtBaseTaskComponent {
372379
}
373380
} else {
374381
if (anchorRect.top + anchorRect.height + flyoutRect.height + this._edgePadding > windowRect.height) {
375-
// it will render offscreen bellow, move it up a bit
382+
// it will render offscreen below, move it up a bit
376383
top = windowRect.height - flyoutRect.height - this._edgePadding;
377384
} else {
378385
top = Math.max(anchorRect.top + anchorRect.height, this._edgePadding);

0 commit comments

Comments
 (0)