Skip to content

Default slot content not detected/attached with defaultSlotContent enabled #178

Description

@nathanacurtis

Problem

When a component has a slot prop with default slot content configured (Config.processing.defaultSlotContent enabled), the default variant's slot element doesn't pick up its default content example — but only in the specific case where the slot's layer is hidden in the Figma asset (e.g. bound to a conditional visible binding) while still carrying its default content underneath. Non-default variant overrides for the same slot correctly reference their content example even when hidden; the default case does not, and falls back to an unbound/empty slot — which renders undersized in Figma instead of reflecting the actual default content's dimensions.

Solution

Default slot content detection should still resolve and attach a slot's default content example when the slot's layer is hidden (conditionally or otherwise) but still carries default content, the same way non-default variant overrides already do — visibility should not be used as a proxy for "has no content."

Acceptance criteria

  • A component with defaultSlotContent enabled and a slot prop whose default-variant layer is hidden (but still carries default content) generates a default slot content reference on the default variant's slot element
  • The default variant's slot renders at the size implied by its default content, not an empty/unbound fallback size, even when the layer is hidden

Notes

Repro case: egdsBadge, children slot prop — the layer is hidden by default (bound to a conditional visible binding tied to the Start Visual Visible Figma prop) but still carries its default content. Non-default variants (e.g. labelVisible:false) get a $slotContent reference even while hidden; the default case does not.


Implementation details are tracked internally.

Metadata

Metadata

Assignees

Labels

generatorspecs-from-figma processing engine

Type

Fields

No fields configured for Bug.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions