Skip to content
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

fix(web-components): remove empty text nodes from avatar #33963

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

radium-v
Copy link
Contributor

Previous Behavior

The <fluent-avatar> web component displays as empty when blank content is present in the default slot. This causes the default fallback icon to disappear when there's no text content to display.

New Behavior

This PR adds a routine on slotchange events that removes purely empty text nodes from the default slot. This only happens if there is no slotted innerText in the component.

@radium-v radium-v requested a review from a team as a code owner March 10, 2025 20:51
@radium-v radium-v force-pushed the users/radium-v/wc-avatar-empty-slot branch from d302e67 to fe6f9b4 Compare March 10, 2025 20:53
Copy link

📊 Bundle size report

✅ No changes found

Copy link

Pull request demo site: URL

@@ -0,0 +1,7 @@
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵🏾‍♀️ visual regressions to review in the fluentui-web-components-v3 Visual Regression Report

Accordion 1 screenshots
Image Name Diff(in Pixels) Image Type
Accordion. - Dark Mode.normal.chromium_1.png 2660 Changed
Avatar 4 screenshots
Image Name Diff(in Pixels) Image Type
Avatar.Active.normal.chromium.png 97 Changed
Avatar.Active Appearance.normal.chromium.png 142 Changed
Avatar. - Dark Mode.normal.chromium_1.png 136 Changed
Avatar.Size.normal.chromium.png 953 Changed
Badge 1 screenshots
Image Name Diff(in Pixels) Image Type
Badge. - Dark Mode.normal.chromium.png 511 Changed
Checkbox 1 screenshots
Image Name Diff(in Pixels) Image Type
Checkbox. - Dark Mode.normal.chromium_1.png 3 Changed
RadioGroup 1 screenshots
Image Name Diff(in Pixels) Image Type
RadioGroup. - Dark Mode.normal.chromium_1.png 62 Changed
TextInput 1 screenshots
Image Name Diff(in Pixels) Image Type
TextInput. - Dark Mode.normal.chromium_1.png 288 Changed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants