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
You can’t use LocalStorageRecentSearchesPlugin with autocomplete option defaultActiveItemId (e.g. defaultActiveItemId: 0), because onSubmit lifecycle hook is not fired by autocomplete in this case. LocalStorageRecentSearchesPlugin is based on this hook. It would be good to have the choice, which lifecycle hooks trigger the plugin. In practice also onSelect is needed, but it’s currently only for querySuggestionsPlugin implemented:
PS: It's unclear, whether incompatibility with defaultActiveItemId is intended behavior or a bug. At least it's very confusing and not mentioned anywhere in the docs.
Expected behavior
LocalStorageRecentSearchesPlugin should handle onSubmit and onSelect hook. At least, it should be mentioned in the docs, if it's not possible.
Environment
Autocomplete version: 1.7.1
The text was updated successfully, but these errors were encountered:
Description
You can’t use
LocalStorageRecentSearchesPlugin
with autocomplete optiondefaultActiveItemId
(e.g.defaultActiveItemId: 0
), becauseonSubmit
lifecycle hook is not fired by autocomplete in this case.LocalStorageRecentSearchesPlugin
is based on this hook. It would be good to have the choice, which lifecycle hooks trigger the plugin. In practice alsoonSelect
is needed, but it’s currently only forquerySuggestionsPlugin
implemented:autocomplete/packages/autocomplete-plugin-recent-searches/src/createRecentSearchesPlugin.ts
Line 57 in dc8b6f2
PS: It's unclear, whether incompatibility with
defaultActiveItemId
is intended behavior or a bug. At least it's very confusing and not mentioned anywhere in the docs.Expected behavior
LocalStorageRecentSearchesPlugin
should handleonSubmit
andonSelect
hook. At least, it should be mentioned in the docs, if it's not possible.Environment
The text was updated successfully, but these errors were encountered: