-
Notifications
You must be signed in to change notification settings - Fork 0
docs: document focused element skip behavior and data-lvt-force-update #35
Description
Context
This follow-up task was identified during the review of PR #32.
Source PR: #32
PR Title: fix: skip patching focused form elements during DOM update
Suggested by: @claude[bot] (PR comments)
Task Description
Document the focused-element skip behavior and the data-lvt-force-update escape hatch in user-facing documentation (README or dedicated docs page).
What to document
-
Default behavior: When a user is typing in a form element (input, textarea, select), the client skips DOM patching for that element to preserve cursor position and user input. Server updates resume when the element loses focus.
-
data-lvt-force-updateattribute: Add this attribute to any form element that should always receive server updates, even when focused. Use when server authority must override local state (e.g., server-side validation that reformats a value, or disabling a field). -
Tradeoff: While focused, non-value attributes (class, disabled, aria-*) are also skipped. Use
data-lvt-force-updateif the server needs to update these while the element is focused. -
Works with
Change(): This behavior enables theChange()method for live-as-you-type updates without cursor jumping.
This issue was automatically created from PR review comments.