Skip to content

Commit

Permalink
fix: render person-card inside parent container (#3324)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mnickii authored Oct 2, 2024
1 parent a8f4099 commit ae49332
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ export class MgtPersonCard extends MgtTemplatedTaskComponent implements IHistory

if (this._windowHeight < 250) {
this._smallView = true;
this.fireCustomEvent('smallView', null, true);
}
const tabLocker = this.lockTabNavigation
? html`<div @keydown=${this.handleEndOfCard} aria-label=${this.strings.endOfCard} tabindex="0" id="end-of-container"></div>`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ export class MgtFlyout extends MgtBaseTaskComponent {
this.updateFlyout();
});
});

// handling when person-card is rendered in a smaller window
this.addEventListener('smallView', () => {
window.requestAnimationFrame(() => {
this.updateFlyout();
});
});
}

/**
Expand Down Expand Up @@ -372,7 +379,7 @@ export class MgtFlyout extends MgtBaseTaskComponent {
}
} else {
if (anchorRect.top + anchorRect.height + flyoutRect.height + this._edgePadding > windowRect.height) {
// it will render offscreen bellow, move it up a bit
// it will render offscreen below, move it up a bit
top = windowRect.height - flyoutRect.height - this._edgePadding;
} else {
top = Math.max(anchorRect.top + anchorRect.height, this._edgePadding);
Expand Down

0 comments on commit ae49332

Please sign in to comment.