Skip to content

[Autocomplete][v1] No empty state when using conditional rendering in the emptyState props #1294

@mehdi-loup

Description

@mehdi-loup

Issue summary

When typing the first letters of an input without suggestions, the expected behaviour would be to display the empty state to indicate the user no results were found for its current input. Instead the user needs to focus out and refocus in the input to have the empty displayed.

Expected behavior

The empty state should be displayed every time a user input does not receive autocomplete suggestions.

Actual behavior

Here is a screencast of the current behaviour:
https://screenshot.click/screencast_2019-04-09_10-21-59.gif

Steps to reproduce the problem

1- Implement a conditional emptyState in the Autocomplete component
2- Type an invalid input not returning suggestion: ww for example in the following codesandbox
3- Observe that the popover won't display

Reduced test case

The problem was reproduced here:
https://codesandbox.io/s/61pwy3392w

Specifications

  • Are you using the React components? (Y/N): Y
  • Polaris version number: 3.11.0
  • Browser: Google Chrome Version 73.0.3683.86 (Official Build) (64-bit)
  • Device: MacBook Pro
  • Operating System: MacOS 10.14.4 (18E226)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething is broken and not working as intended in the system.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions