Status: shipped (core) · Priority: high
Note: The core below is shipped, not a proposal —
InputNodeis a real text field.select/textareaand the:focuspseudo-class remain future.
Shipped → main docs.
<input>behavior (caret, selection, undo/redo, clipboard, attributes) is documented for users in Elements Overview. This page keeps what remains.
Making <input> a real text field. Shipped: InputNode (runtime/cpp/ui/input.h, ~1000 lines) renders text via the FreeType pipeline with caret, selection, undo/redo, clipboard, and full keyboard editing — key events route to the focused node (MorphNode::s_focusedNode, runtime/cpp/core/window.cpp).
The <input> element is registered and fully implemented, so users can type into it. morph check still flags select / textarea:
morph check flags them: registered but not fully implemented in the runtime yet (mx-tag-stub)s_focusedNode), falling back to the node under the cursor when nothing has focus| Piece | State |
|---|---|
InputNode widget (styled box + scroll + scrollbar) |
✅ Shipped (runtime/ui/input.h) |
MorphNode::focused / s_focusedNode focus lifecycle + focus()/blur() |
✅ Shipped (runtime/cpp/core/node.h, routed in window.cpp) |
Keyboard routing to focused node + onKeyEvent/onTextChar consumption |
✅ Shipped (window.cpp) |
| Text rendering / caret (blink, measurement-positioned) / selection (click-drag, Shift+arrows, highlight) | ✅ Shipped (drawTextAndCaret, measureTextWidth) |
Editing — typing, backspace/delete, arrows, Home/End, Ctrl+A/X/C/V, undo/redo, clipboard, maxLength/password |
✅ Shipped |
EventType::Focus / Blur |
✅ Declared (event.h, node.h) — never dispatched |
:focus CSS pseudo-class |
❌ Not built |
select / textarea elements |
❌ Same stub status (STUB_TAGS in morph-parser) |
focused; a focus()/blur() API; Focus/Blur events dispatched through the existing event system; keyboard events route to the focused node instead of the hovered onemorph_text.h) for the input valueselect / textarea — once the focus + text plumbing exists, these become small variations (single-line vs multi-line wrap):focus pseudo-class is a natural pairing (currently unsupported)Plain fields cover forms; docs, notes, and chat need rich text — bold/italic, links, lists, inline images, and ideally markdown in/out. Full support means a <richtext> element with a document model (block + inline spans, not a string with aspirations), selection across blocks, IME-safe composition, and copy/paste that preserves structure (HTML on the clipboard, not flattened text). Explicitly not v1: collaborative editing — that's a server with opinions, and this is a text box. It builds on the shipped caret/selection/clipboard plumbing above; the new work is the document model and the clipboard fidelity.
focused lifecycle, Focus/Blur events, key routing to focused nodeInputNode:focus CSS pseudo-class + Focus/Blur event dispatchtextarea (multi-line) + select (dropdown)<richtext> document model + structured clipboard (full support, later)