Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autocomplete onStateChange #300

Open
Blindmikey opened this issue Mar 9, 2023 · 2 comments
Open

autocomplete onStateChange #300

Blindmikey opened this issue Mar 9, 2023 · 2 comments
Labels
enhancement New feature or request templates Requires template modifications
Milestone

Comments

@Blindmikey
Copy link

Is your feature request related to a problem? Please describe.
Need to trigger a polyfill after state change.

Describe the solution you'd like
Open the onStateChange parameter in your custom instance of window.autocomplete
https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/state/#listening-to-state-changes

Additional context
Perhaps this is already available, but I cannot find if after digging through documentation.

@tw2113
Copy link
Member

tw2113 commented Mar 9, 2023

Hi @Blindmikey

Something to keep in mind, that we're aware of and are still trying to resolve, is that our implementation of Autocomplete is still on version 0.38.x. So it's possible that the autocomplete templates that we ship with need some overhaul for this onStateChange functionality to be available.

The good news is that our templates are basically just files that we store all the javascript on, and can be completely overwritten, but I also know and admit is extra work on the plugin user's side. I also know that I've done my own override from our plugin for a client and got them updated to Autocomplete 1.x in the process.

In case curious, one big hurdle is that with version 0.38.x we were able to specify a selector for what to attach the Autocomplete UI to out of box, like common pattern WordPress search forms. With version 1.x, they moved to looking for something like <div id="autocomplete"></div> for their DOM selecting, and that's much less easy to consistently find, if find at all, for out-of-box Autocomplete integration.

@tw2113
Copy link
Member

tw2113 commented Mar 9, 2023

That said, leaving this issue open to keep it in mind for hopefully when we get to the point of getting our plugin Autocomplete integration updated.

@tw2113 tw2113 added enhancement New feature or request templates Requires template modifications labels Mar 10, 2023
@asharirfan asharirfan added this to the 3.0.0 milestone Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request templates Requires template modifications
Projects
None yet
Development

No branches or pull requests

3 participants