You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: keep focus and caret when typing in ody-input text fields
Typing a character into <ody-input>, <ody-inline-input>, or
<ody-search-input> reflected the value back through the observed
`value` attribute, so the base class ran a destructive re-render on
every keystroke — recreating the native <input> and dropping focus
and caret position.
Override attributeChangedCallback in the three controlled inputs to
special-case `value`: push it into the live control in place via a
new reflectControlValue helper (a no-op when the control already
holds it, so the caret is never disturbed) and update the character
counter / clear button imperatively, skipping render(). Every other
observed attribute still re-renders chrome through the base.
ody-money-input / ody-percentage-input were already unaffected — they
write the private #value on input and only reflect on blur.
Adds regression tests (focus + caret retained across keystrokes,
clear button toggled in place, chrome still re-renders) and documents
the invariant in ARCHITECTURE.md.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments