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

feat: implement onFocus callback inside InputSearch #1445

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bgoyarts
Copy link

What is the purpose of this pull request?

Related: vtex-apps/store-components#1074

The InputSearch component is not calling the onFocus callback that can be set on the props. This creates an issue as described inside the store-components. When the InputSearch component is being rendered as the main searchbar, the autocomplete is not opened by default if this is configured.

What problem is this solving?

This solves the issue of the non-appearing auto-complete bar when using the inputType: search configuration on the searchbar component.

How should this be manually tested?

Steps to reproduce the behavior:

  1. Place the store-components searchbar somewhere in your template with the following props:
{
  "props": {
    "openAutocompleteOnFocus": true,
    "inputType": "search"
  }
}
  1. Go to your store, put your cursor inside the input field so it receives focus
  2. Autocomplete is not expanded

Expected behavior
The autocomplete should be expanded showing top searches and search history

Screenshots or example usage

current result
searchbar-issue-actual

fix
searchbar-issue-fixed

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Requires change to documentation, which has been updated accordingly.

@vercel
Copy link

vercel bot commented Jul 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
styleguide ❌ Failed (Inspect) Jul 24, 2023 1:17pm

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit d64b4a1:

Sandbox Source
vtex-styleguide-pr Configuration

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.

1 participant