Skip to content

Async: defaultOptions={true} gives strange behaviour when lodash debounce function is in use #5359

@jphawk

Description

@jphawk

Hello,

I noticed that AsyncSelect behaviour is weird when I use a lodash debounce function together with defaultOptions={true}. When I use keyboard to focus the Select component, I can start typing and both loading state in the menu and options appear as intended. However, when I click the Select component, I can see a Loading state in the Menu for a moment which I think isn't supposed to be visible and then it disappears. Looks like there is some difference in handling this between onClick and onFocus events.

Here is a Sandbox where you can check this bug.

How to reproduce?

  1. On first render click on AsyncSelect with an empty input
  2. Menu with Loading state appears which is not an intended behaviour. If the Menu with Loading doesn't appear, try reloading the page and it will be there.
  3. After that component works as intended. Loading state doesn't appear on next clicks with an empty input.

Can be compared to the keyboard behaviour:

  1. On first render Tab to AsyncSelect
  2. Menu with Loading state doesn't appear
  3. Component works as intended

Are you reporting a bug or runtime error?

Bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/bug-unconfirmedIssues that describe a bug that hasn't been confirmed by a maintainer yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions