Skip to content

Conversation

@camertron
Copy link
Contributor

In certain scenarios, most notably Turbo navigation, <auto-complete> elements do not respond to events like keypresses and appear to be entirely non-functional. This is because the element relies on certain child elements being present in the DOM when connectedCallback fires, an assumption that is not always accurate, i.e. in the Turbo case. This PR adds a mutation observer that triggers a callback when the child elements have loaded. The callback performs the necessary setup that makes the element function normally.

@camertron camertron marked this pull request as ready for review March 5, 2024 23:20
@camertron camertron requested a review from a team as a code owner March 5, 2024 23:20
@camertron camertron requested a review from keithamus March 5, 2024 23:20
Copy link
Contributor

@keithamus keithamus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@keithamus keithamus merged commit 48c2d2c into main Mar 6, 2024
@keithamus keithamus deleted the reattach_on_mutate branch March 6, 2024 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants