Skip to main content

reconcile_if_blocks

Function reconcile_if_blocks 

Source
pub fn reconcile_if_blocks(
    store: Res<'_, PropertyStore>,
    markers: Query<'_, '_, (Entity, &mut IfMarker, Option<&Children>)>,
    styles: Query<'_, '_, (&mut Style, &mut StyleOverrides)>,
    fade_targets: Query<'_, '_, (Option<&TransitionSpecs>, Option<&Opacity>)>,
    commands: Commands<'_, '_>,
)
Expand description

Reconcile every <if> block against the current PropertyStore truthiness. Truthy: property exists AND value is not empty AND is not literal "false" / "0".

Mode policy:

  • IfMode::Render (default) - despawn the body on falsy, respawn on truthy. Cheap memory; loses focus / scroll / per-row signals across the toggle.
  • IfMode::Hide - mount the body once on the first truthy transition. Hiding flows through Style.display = Display::None on the if-marker entity (spec section 17.4: space is released, siblings reflow on the next tick via Changed<Style>) and additionally stamps Visible(false) so the render extract, hit-test, and focus paths skip the subtree while all descendant state (focus, scroll, per-row signals) survives. Both writes happen only on an actual transition (D5) - steady ticks touch nothing, so FrameDirty stays clear.