Skip to content

Commit 49f5508

Browse files
committed
🔥 example(term): drop empty-value workaround now handled by renderer
The `value || " "` fallback previously worked around the renderer's inability to attach a caret to an empty text node. That case is now handled directly by the renderer, so the example can pass the raw value through and let the caret resolve at the input box's origin.
1 parent 8d47bad commit 49f5508

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

examples/text-input/index.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,7 @@ function frame(value: string, caret: number): Op[] {
114114
},
115115
bg: inputBg,
116116
}),
117-
// A single space stands in for an empty value: Clay does not emit a
118-
// text render command for an empty string, which means the renderer
119-
// cannot resolve the caret's cell when the field is empty. The space
120-
// is invisible against the input background. When the renderer
121-
// gains a fallback for empty-text carets, drop the `|| " "`.
122-
text(value || " ", { color: label, caret }),
117+
text(value, { color: label, caret }),
123118
close(),
124119
open("hint", { layout: { height: fixed(1) } }),
125120
text("← → move Backspace delete Esc or Ctrl+C exit", { color: hint }),

0 commit comments

Comments
 (0)