Skip to content

docs: document focused element skip behavior and data-lvt-force-update #35

@adnaan

Description

@adnaan

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

  1. 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.

  2. data-lvt-force-update attribute: 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).

  3. Tradeoff: While focused, non-value attributes (class, disabled, aria-*) are also skipped. Use data-lvt-force-update if the server needs to update these while the element is focused.

  4. Works with Change(): This behavior enables the Change() method for live-as-you-type updates without cursor jumping.


This issue was automatically created from PR review comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    follow-upFollow-up task from PR reviewfrom-reviewIssue originated from PR review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions