Components
← All components

Editable

stimeo--editable

Inline edit: click or F2 to edit text in place, Enter to save, Escape to cancel.

The stimeo--editable controller turns a display element into an inline editor. Activating the display (Enter/Space on the button, or F2) enters edit mode, focuses the input and selects its text. Enter (or Ctrl+Enter / Cmd+Enter for a multiline textarea) saves and Escape cancels; both return focus to the display element. With submitOnBlur (the default) losing focus also saves, honoring wherever focus moved. Saving updates the display text and dispatches stimeo--editable:change with { value, previous } only when the value actually changed; cancelling dispatches stimeo--editable:cancel. The look is your CSS, keyed off data-mode.

running
Click the title to edit it (Enter saves, Esc cancels).
Click the description to edit it (Enter for a newline, Ctrl+Enter / Cmd+Enter saves, Esc cancels).

Keyboard

KeyAction
Enter / Space / F2 Enter edit mode from the display element.
Enter Save (single-line); inserts a newline in a textarea.
Ctrl+Enter / Cmd+Enter Save when editing a multiline textarea.
Esc Discard changes and return to display mode.