Skip to content

✨ input: add semantic text editing actions - #28

Closed
cowboyd wants to merge 1 commit into
tree-event-listenerfrom
tree-input
Closed

cowboyd wants to merge 1 commit into
tree-event-listenerfrom
tree-input

Conversation

@cowboyd

@cowboyd cowboyd commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

An editable input is the first element that exercises the complete interactive architecture rather than only one layer. It must become focusable when attached, receive key events through the focused dispatch path, maintain semantic editing state, participate in layout, request frames through Host mutations, and emit typed changes to raw or framework consumers. Building it from the APIs already introduced demonstrates that interactive elements can be authored as composable extensions instead of privileged core cases.

Editing behavior lives in InputApi, independent of any particular framework. The model uses code-point positions rather than UTF-16 code units, normalizes pasted line breaks for a single-line control, and keeps key-repeat behavior input-specific. Emitting input only when the value changes gives every adapter the same predictable onInput semantics.

host.addEventListener(input, 'input', (event) => {
	console.log(event.value);
});

This PR adds the typed input element and semantic insert, delete, and caret movement operations. It composes focus, keyboard handling, layout, and typed input events while exposing the current value and caret through element properties. Tests cover editing boundaries, multi-code-unit characters, key mappings, repeats, delegation, and event emission.

@pkg-pr-new

pkg-pr-new Bot commented Aug 7, 2026 •

Copy link
Copy Markdown

commit: baeda0c

@cowboyd

cowboyd commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

closing out in favor of a DOM based substrate. See #37

@cowboyd cowboyd closed this Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant