-
Notifications
You must be signed in to change notification settings - Fork 615
<f-when> Does Not Re-evaluate After Hydration #7321
Copy link
Copy link
Open
Labels
status:triageNew Issue - needs triageNew Issue - needs triage
Description
🐛 Bug Report
After client-side hydration, structural template directives (<f-when>,
<f-repeat>) and property bindings (:prop) do not re-evaluate when their
underlying @observable properties change. Simple {{interpolation}} and
attribute bindings DO work reactively, creating an inconsistency that forces
app developers into imperative DOM workarounds.
| Field | Detail |
|---|---|
| Expected | <f-when condition="showSection"> hides/shows its content when showSection changes. |
| Actual | The <f-when> block reflects only the initial server-rendered state. Toggling the observable has no effect on the DOM. The {{showSection}} interpolation in nearby text DOES update. |
| Root cause | <f-when> is a compile-time directive processed by @microsoft/fast-html during SSR. During defer-and-hydrate, the hydration pass does not subscribe the <f-when> block to the condition observable. |
| Affected apps | settings_btr (back button visibility), downloads_btr (empty state), permission_prompt_btr, all BTR apps using conditional rendering. |
| Severity | P1 — Broken functionality. Any BTR page that needs to show/hide sections based on state changes is affected. |
| Workaround | Imperative DOM manipulation — manually create/remove elements instead of relying on <f-when>. See Workaround A. |
| Suggested fix | Framework-level: <f-when> blocks should subscribe to their condition observable during hydration, mirroring when() behavior in standard FAST Element. |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
status:triageNew Issue - needs triageNew Issue - needs triage