diff --git a/src/lib/actions/paramInput.ts b/src/lib/actions/paramInput.ts index 288b34ee..7a91bb0d 100644 --- a/src/lib/actions/paramInput.ts +++ b/src/lib/actions/paramInput.ts @@ -1,18 +1,24 @@ /** - * Svelte action for consistent keyboard handling on parameter inputs. + * Svelte action for entry fields: parameters, names and settings. + * + * An entry is committed by the `change` event of the field, which fires on + * Enter or when the field is left, and only if the value changed. Fields + * listen to `onchange`, not `oninput`, so a half typed value is never + * committed: no undo step, live mutation or evaluation per keystroke. * * Features: - * - Escape: unfocus (blur) the input, stops propagation + * - Escape: restore the value the field had when it was focused and unfocus + * it, so no `change` fires and nothing is committed; stops propagation * - Enter: optionally blur (for single-line inputs, not textareas) * * Usage: - * + * commit(e.currentTarget.value)} use:paramInput /> * *