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

Async data fetching = flashing during load #729

Open
ztratar opened this issue Feb 1, 2024 · 1 comment
Open

Async data fetching = flashing during load #729

ztratar opened this issue Feb 1, 2024 · 1 comment

Comments

@ztratar
Copy link

ztratar commented Feb 1, 2024

Steps to reproduce:

  1. Implement async data fetching
  2. Use with autocomplete
  3. Even if you type the word that exists in the options, the box will flash as the load is occuring

Expected behaviour:

  • I'd expect, unless the user provides a loading state, that old data from the (n-1) length query is replaced with new data. Skip the isOpened flash all-together.

Observed behaviour:

  • There's a loading state in between, which causes a lack of data and a flash, even for really fast responses.

Workaround:

  • I literally can't. I've tried passing in my own data via async queries, but react-mentions appears incapable of handling data from useState passed in unless it's reacting specifically to an async query in the data prop. I would love it if the entire thing was reacting to the data prop, so I could work around this issue myself instead.
@rafaelderolez
Copy link

@ztratar I just ran into this issue as well. Trying my luck here, but did you ever find a workaround in the end?

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

No branches or pull requests

2 participants