[Bug]: Inherited CSS white-space cascades into shadow boundary; :host reset is not reliable
Los mantenedores suelen responder en 2 días
@radium-v ya está trabajando en esto.
Desde el 10/6/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Related Issue
Follow-up to #36282 — splitting into focused issues for clearer tracking.
Component
All components with shadow DOM
Package version
3.0.0-rc.15
@microsoft/fast-element version
2.10.4
Environment
System:
OS: macOS 15.7.7
CPU: (8) x64 Apple M2
Memory: 20.61 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Browsers:
Chrome: 149.0.7827.53
Edge: 148.0.3967.96
Safari: 26.0.1
npmPackages:
@fluentui/react-components: 9.73.8 => 9.73.8
@fluentui/web-components: 3.0.0-rc.15 => 3.0.0-rc.15
@microsoft/fast-element: ^2.10.4 => 2.10.4
Current Behavior
CSS properties like white-space inherit through the shadow boundary, affecting internal component rendering. When a parent sets white-space: pre or similar, it cascades into the component and changes layout behavior unexpectedly.
Additionally, using :host { white-space: normal; } as a defensive reset has a weakness — it can be overridden by greedy * selectors in consumer styles.
Current workarounds
- Consumer-side patch: Set
fluent-field { white-space: normal; }in light DOM - Component-side
:hostreset: Setwhite-space: normalon:hostin shadow stylesheet- ⚠️ Can be overridden by consumer
*selectors
- ⚠️ Can be overridden by consumer
Proposed Solutions
- Wrapper root element with
white-spacereset — Wrap template content in an element withwhite-space: normal(more resilient but changes DOM structure). A root element encapsulates more effectively than :host :hostreset forwhite-space— Addwhite-space: normalto:hostin component stylesheets (with caveat that consumer*selectors can override)- Eliminate whitespace from templates — Ship single-line templates in ESM (requires per-template care since some whitespace may be structural)
Expected Behavior
Components should encapsulate their internal styling and not be affected by inherited CSS properties from parent elements.
Reproduction
https://stackblitz.com/edit/vitejs-vite-vcgc2r59?file=src%2Fmain.js
Steps to reproduce
- Open the StackBlitz reproduction
- Observe how inherited
white-spacevalues affect component rendering - Try applying
:host { white-space: normal; }and note it can still be overridden
Are you reporting an Accessibility issue?
None
Suggested severity
Normal
Products/sites affected
No response
Are you willing to submit a PR to fix?
yes
Validations
- Check that there is not already an issue that reports the same bug to avoid creating a duplicate.
- The provided reproduction is a minimal reproducible example of the bug.
- Lenguaje dominante
- TypeScript
- Estrellas
- 20.4k
- Forks
- 3k
- Merge medio
- 3 d 21 h
- PR fusionados (30 d)
- 99
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/fluentui
-
[Bug]: Accordion crashes for scalar `defaultOpenItems={0}` (headless and styled v9)Posiblemente ocupada @arniebradfo la tomó hace 2 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
-
[Bug]: Button shims in react-migration-v8-v9 always render the ms-Button--primary classPosiblemente ocupada @jakesalvesen la tomó hace 13 días. AbiertoComponent: Button Fluent UI react-components (v9) Type: Bug :bug:
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
[Bug]: AreaChart renders SVG rect with negative width and height on initial renderPosiblemente ocupada @AtishayMsft la tomó hace 9 días. AbiertoPackage: charting Type: Bug :bug:
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
microsoft/fluentui#36976 · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
[Bug]: Vertical Slider still logs the deprecated 'slider-vertical' warning in Chromium 132+Posiblemente ocupada @jakesalvesen la tomó hace 16 días. AbiertoComponent: Slider Fluent UI react-components (v9) Type: Bug :bug:
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
microsoft/fluentui#36945 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
[Bug]: fluent-checkbox submits "on" when the checked attribute is before valuePosiblemente ocupada @FOWEPJF255 la tomó hace 10 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
Todos los issues de microsoft/fluentui
Issues similares
-
Report: &TV InternationalAbiertocheck:passed streams:remove
Dificultad 1/5 Menos de una hora Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
bug priority-p1
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
beginner blocked
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
hiero-ledger/hiero-sdk-js#4670 ·
Los mantenedores suelen responder en 1 día
-
[Exploratory] Expense - 2 selected drop-down is shown twice when selecting hold from more option.AbiertoMonthly Not a priority
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Expensify/App#106080 · 1 comentario ·
Los mantenedores suelen responder en 1 día