-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] - Template lines of MGT-Person component no longer show ellipsis #2975
Comments
Thanks for sharing @JHolah! I agree with your analysis and this was missed when moving to Fluent UI. We'll be queuing this bug for our post-v4 release. If you have time / want to send a PR our way, feel free and we'll be happy to provide guidance and reviews! |
Hi @JHolah, this change was deliberate and driven out of accessibility requirements to not truncate visible text, this creates a disparity of experience between sighted users and those using screen reading technology. What we can do is ensure that you can target these elements via a css selector. using something like: mgt-person::part(detail-line) {
overflow: hidden;
text-overflow: ellipsis;
width: -webkit-fill-available; // or and explicit width
white-space: nowrap;
} Coupled with this you'd need to restrict the width of the detail-wrapper by setting the Would that allow you to meet your requirements? |
Thanks, @gavinbarron, I will see where we get with that and report back here. |
@JHolah we'll need to add a part attribute into the markup we write in the shadow DOM for this to work. Sounds like if we did so it would resolve your challenges so we'll go with that plan. |
Thank you, @gavinbarron. I was struggling to get things to work this way so that's much appreciated. Given that this is an intended change for accessibility, we are happy to roll with the change. If there is a way to reinstate things as per your plan, then that's a bonus, but an accessibility-first approach makes the most sense. |
Describe the bug
MGT v3 has changed the styles of the template lines in the Person component so that text overflow is handled differently. There is currently no workaround or exposed CSS property to reinstate the styles.
The previous version enabled an ellipsis for any overflowing text in the details area, limiting it to a single line. The new version allows text to wrap to a new line. In our situation, this breaks the UI of several components in which the MGT Person component is used.
Steps to reproduce the behavior:
Note that details text wraps to a new line where previously it was clamped to one line with an ellipsis.
Expected behavior
Any details line which exceeds the available space should be hidden, with text-overflow: ellipsis
It appears that the following CSS properties that exist in the previous version, are no longer applied:
Screenshots
![old](https://private-user-images.githubusercontent.com/2090181/299950150-556f276e-305a-40c5-948b-0e4f2bc45c99.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk3NzAzMTUsIm5iZiI6MTcxOTc3MDAxNSwicGF0aCI6Ii8yMDkwMTgxLzI5OTk1MDE1MC01NTZmMjc2ZS0zMDVhLTQwYzUtOTQ4Yi0wZTRmMmJjNDVjOTkucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYzMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MzBUMTc1MzM1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YzFjMzcwMTk2NTdiOTBjZmZkZDEwMTdjNDliYjNkZWM0OTlhOTE3MTM3Y2JkNTE4OWY5NmIzZTk2NGI4YTRhNyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.n_EKhvELGrkWkNxpyaUK_CSjyGZQ9KROuPRh45xL84Q)
The previous version limited text to one line:
Environment (please complete the following information):
Additional context
It may be that this is an intended change after all, but in our cases, it breaks a lot of things The need to have line overflow styles remains. Exposing CSS properties for this would also be an acceptable solution.
The text was updated successfully, but these errors were encountered: