Context
This follow-up task was identified during the review of PR #292.
Source PR: #292
Suggested by: @claude[bot]
Task Description
lvt-el:removeClass:on:focusout="open" fires whenever focus leaves any element inside the component — including when focus moves from the input to a suggestion item via keyboard Tab. This incorrectly closes the dropdown mid-selection.
The old Blur() approach handled this implicitly via server-side logic.
Fix: Use onfocusout with a relatedTarget check to avoid closing when focus moves within the component:
onfocusout="if(!this.closest('[data-autocomplete]').contains(event.relatedTarget))this.closest('[data-autocomplete]').classList.remove('open')"
Or add a small delay before hiding to allow focus to settle.
This issue was automatically created from PR #292 review comments.
Context
This follow-up task was identified during the review of PR #292.
Source PR: #292
Suggested by: @claude[bot]
Task Description
lvt-el:removeClass:on:focusout="open"fires whenever focus leaves any element inside the component — including when focus moves from the input to a suggestion item via keyboard Tab. This incorrectly closes the dropdown mid-selection.The old
Blur()approach handled this implicitly via server-side logic.Fix: Use
onfocusoutwith arelatedTargetcheck to avoid closing when focus moves within the component:onfocusout="if(!this.closest('[data-autocomplete]').contains(event.relatedTarget))this.closest('[data-autocomplete]').classList.remove('open')"Or add a small delay before hiding to allow focus to settle.
This issue was automatically created from PR #292 review comments.