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: @Copilot (review comment)
Task Description
PR #32 added unit tests for shouldSkipUpdate but lacks integration tests that exercise the full updateDOM() path with morphdom. Add regression tests covering:
- Focused textarea is not modified during an update — type in a textarea, trigger updateDOM with server content, verify textarea value and cursor position are preserved
- After blur, server updates apply again — focus a textarea, trigger update (skipped), blur, trigger another update, verify server content is applied
- Unfocused textarea
.value is updated from server-rendered content — verify the onElUpdated textContent→value sync works for dirty textareas
Implementation notes
- These tests will need to instantiate
LiveTemplateClient or at minimum call updateDOM directly with morphdom
- May need to mock WebSocket transport
- Should use real DOM focus/blur (not private field mutation)
This issue was automatically created from PR review comments.
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: @Copilot (review comment)
Task Description
PR #32 added unit tests for
shouldSkipUpdatebut lacks integration tests that exercise the fullupdateDOM()path with morphdom. Add regression tests covering:.valueis updated from server-rendered content — verify theonElUpdatedtextContent→value sync works for dirty textareasImplementation notes
LiveTemplateClientor at minimum callupdateDOMdirectly with morphdomThis issue was automatically created from PR review comments.