microsoft-graph-toolkit icon indicating copy to clipboard operation
microsoft-graph-toolkit copied to clipboard

[BUG] - Alignment of details lines in Person component is no longer centered when using a large profile photo

Open JHolah opened this issue 2 years ago • 4 comments

Describe the bug The new version no longer applies center-aligned content when the profile image is larger than the vertical space occupied by the details text.

To Reproduce Steps to reproduce the behavior:

  1. Go to MGT playground Person component: https://mgt.dev/?path=/story/components-mgt-person--person
  2. Insert the following code into the HTML section:

<mgt-person person-query="me" view="threeLines" class="example" person-card="hover"></mgt-person>

  1. Insert the following code into the CSS section:
.example {
      --person-avatar-size: 120px
}
  1. Note that the text is not vertically-aligned:

v3align

Expected behavior The image and text should be center aligned:

v2align

CSS which handled the alignment no longer exists in the new version:

new:

:host .flyout [slot="anchor"] {
    display: flex;
    cursor: pointer;
}

old:

:host .person-root, mgt-person .person-root {
    position: relative;
    display: flex;
    align-items: center;
    color: var(--color,var(--color-sub1,#323130));
}

Environment (please complete the following information):

  • Chrome
  • react
  • SharePoint

Additional context Add any other context about the problem here.

JHolah avatar Jan 26 '24 12:01 JHolah

Note that it works fine (vertically centered) if the Person component doesn't have the person-card property, but as the Person card adds a wrapping div, the alignment stops working.

Rafaelki avatar Jan 26 '24 15:01 Rafaelki

Oh. This is a good catch! Thanks for reporting it! And thanks @Rafaelki for the additional insights! This is a bug and should be fixed. Thanks!

If you ever feel like it @JHolah, we are happy to accept PR with the fixes! If not, we'll queue it for a fix after our v4 release that should shortly happen. Thanks!

sebastienlevert avatar Jan 26 '24 15:01 sebastienlevert

Thanks @JHolah and @Rafaelki!

I really appreciate the quality of issues from you both, it makes like as a maintainer much easier when we get super clear repos and descriptions of the problems you all are facing.

gavinbarron avatar Jan 26 '24 17:01 gavinbarron

I just tested this with the next version the playground https://mgt.dev/next/?path=/story/components-mgt-person-html--person and it looks like this was resolved in #2900

gavinbarron avatar Jan 30 '24 17:01 gavinbarron