You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DropZone exposes minEmptyHeight so an empty slot keeps a visible height when the parent container is laid out as a column. There is no equivalent for width, so an empty DropZone placed inside a row-oriented parent collapses to width: 0 and becomes invisible and unclickable — even when its height is preserved by minEmptyHeight.
Users who use DropZone as the flex container of a layout component (for example a generic Box block whose flex-direction is configurable) hit this the moment the author chooses row: the first drop target has no area to hit, and any empty children already placed disappear from view. The expected outcome is that DropZone keeps an empty slot visible on both axes, regardless of flex-direction / collisionAxis.
Minimal repro
A custom block that makes DropZone the flex container with a configurable direction:
--min-empty-height is already emitted by the DropZone render and consumed by the built-in DropZone styles. A width counterpart can follow the same wiring.
Relevant source areas (inferred):
the DropZone component that applies --min-empty-height inline style
the DropZone stylesheet that applies min-height: var(--min-empty-height)
Browser-side workarounds exist (CSS :has()), but they require Chrome 105+ / Safari 15.4+ / Firefox 121+ and must reach into Puck internals (data-puck-dropzone / data-puck-component attributes), so a prop-level fix is strictly better.
Proposals
Proposal 1 — add a minEmptyWidth prop that mirrors minEmptyHeight
Add minEmptyWidth?: number | string to DropZoneProps, emit --min-empty-width from the DropZone render, and apply min-width: var(--min-empty-width, 0) in the built-in DropZone styles.
Two related props (minEmptyHeight / minEmptyWidth) instead of one. See Proposal 2 for an alternative.
Proposal 2 — expose a single minEmpty that covers both axes
Collapse the two into one prop:
minEmpty={64}// both axesminEmpty={{x: 64,y: '8vh'}}// axis-specific
Pros: smaller surface. Cons: deprecates minEmptyHeight, larger change, a bit more indirection to learn.
Workaround (current)
For reference, our consumer emits a custom CSS variable --box-min-empty-width from render and uses a :has()-gated rule to apply min-width only when the DropZone has no child [data-puck-component] children. It works but depends on Puck's internal attributes and the :has() selector.
Description
DropZoneexposesminEmptyHeightso an empty slot keeps a visible height when the parent container is laid out as a column. There is no equivalent for width, so an emptyDropZoneplaced inside a row-oriented parent collapses towidth: 0and becomes invisible and unclickable — even when its height is preserved byminEmptyHeight.Users who use
DropZoneas the flex container of a layout component (for example a genericBoxblock whoseflex-directionis configurable) hit this the moment the author choosesrow: the first drop target has no area to hit, and any empty children already placed disappear from view. The expected outcome is thatDropZonekeeps an empty slot visible on both axes, regardless offlex-direction/collisionAxis.Minimal repro
A custom block that makes
DropZonethe flex container with a configurable direction:Boxwithdirection: 'row'.Boxes inside it.64px × 0px—--min-empty-heightworks, but nothing keeps the width, so they are invisible and have no clickable area.Considerations
minEmptyHeight(px,%,vh, …) #1226 (closed) and the merged PR Support css units forminEmptyHeight#1298, which added CSS-unit support tominEmptyHeight. A width counterpart would benefit from the same treatment so that percent / viewport units work from day one.--min-empty-heightis already emitted by the DropZone render and consumed by the built-in DropZone styles. A width counterpart can follow the same wiring.--min-empty-heightinline stylemin-height: var(--min-empty-height):has()), but they require Chrome 105+ / Safari 15.4+ / Firefox 121+ and must reach into Puck internals (data-puck-dropzone/data-puck-componentattributes), so a prop-level fix is strictly better.Proposals
Proposal 1 — add a
minEmptyWidthprop that mirrorsminEmptyHeightAdd
minEmptyWidth?: number | stringtoDropZoneProps, emit--min-empty-widthfrom the DropZone render, and applymin-width: var(--min-empty-width, 0)in the built-in DropZone styles.Pros:
minEmptyHeight; easy to discover.collisionAxis.minEmptyHeight#1298.Cons:
minEmptyHeight/minEmptyWidth) instead of one. See Proposal 2 for an alternative.Proposal 2 — expose a single
minEmptythat covers both axesCollapse the two into one prop:
Pros: smaller surface. Cons: deprecates
minEmptyHeight, larger change, a bit more indirection to learn.Workaround (current)
For reference, our consumer emits a custom CSS variable
--box-min-empty-widthfrom render and uses a:has()-gated rule to applymin-widthonly when the DropZone has no child[data-puck-component]children. It works but depends on Puck's internal attributes and the:has()selector.