fix(runtime): removing display resets to the default (visible), not persist (Ink divergence) (#89)
vue-tui left `display` out of RESETTABLE_PROPS, so a removed/undefined `display` persisted its prior value (a removed display="none" stayed hidden). Adds `display` to RESETTABLE_PROPS -- the setter already maps undefined -> DISPLAY_FLEX -- so a withdrawn `display` returns to the Box default (visible), per render = f(current props), like flexDirection/flexWrap (G19). Deliberate, documented divergence from Ink (which hides on a present-undefined `display` via DISPLAY_NONE, and persists on omitted) -- recorded in ink-divergences.md. The reset is consistent across the visual and screen-reader paths (both read yoga's display state). Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -89,6 +89,17 @@ deliberate. Divergences fall into a few kinds:
|
||||
Keeping a previous render's value, as Ink does for these two props, is the anomaly — and an
|
||||
inconsistent one, since every other flex prop resets. Maintainer decision (2026-05-30): KEEP.
|
||||
|
||||
### Removing `display` resets to the default (visible)
|
||||
|
||||
- **Ink:** `applyDisplayStyles` (`styles.ts`) sets `DISPLAY_NONE` whenever an explicit
|
||||
`display` is present and not `'flex'` — so a present-but-undefined `display={undefined}`
|
||||
**hides** the box, and an omitted `display` **persists** the prior value.
|
||||
- **vue-tui:** a removed/undefined `display` resets to the Box default `DISPLAY_FLEX`
|
||||
(visible) — the same state as if the prop had never been set.
|
||||
- **Why:** same reasoning as the `flexDirection`/`flexWrap` reset above — render =
|
||||
f(current props): no `display` set → the default (visible). Persisting a withdrawn prop,
|
||||
or flipping it to hidden, is the anomaly. Maintainer decision (2026-05-31): KEEP.
|
||||
|
||||
## Not applicable in Vue
|
||||
|
||||
### React concurrent mode
|
||||
|
||||
Reference in New Issue
Block a user