-
Notifications
You must be signed in to change notification settings - Fork 151
Open
Description
Describe the bug
When setting the inputType prop to search on the searchbar component, the openAutocompleteOnFocus the autocomplete field is not opened when the input field receives focus.
To Reproduce
Steps to reproduce the behavior:
- Place the searchbar somewhere in your template with the following props:
{
"props": {
"openAutocompleteOnFocus": true,
"inputType": "search"
}
}- Go to your store, put your cursor inside the input field so it receives focus
- Autocomplete is not expanded
Expected behavior
The autocomplete should be expanded showing top searches and search history
Desktop (please complete the following information):
- all
Smartphone (please complete the following information):
- all devices
Additional context
The reason why this issue exists:
- Input props are being generated by the downshift helper and passed to the
AutoCompleteInputcomponent here - The props are not individually extracted but are destructured into the
restPropsprop. This is being sent to theInputSearchcomponent coming from the styleguide here - The
InputSearchdoes not handle any focus events other then it's own. There is no callback on theonFocusevent. https://github.com/vtex/styleguide/blob/master/react/components/InputSearch/index.js#L58
minor untidy issue
- https://github.com/vtex-apps/store-components/blob/master/react/components/SearchBar/AutocompleteInput.tsx#L108 The prop
autoCompleteOnFocusis unused
Metadata
Metadata
Assignees
Labels
No labels
