Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

onSearchLink does not render with latest state #291

Closed
hoantran-it opened this issue Sep 23, 2020 · 4 comments
Closed

onSearchLink does not render with latest state #291

hoantran-it opened this issue Sep 23, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@hoantran-it
Copy link

Hi team, I want to report a problem with rich-markdown-editor, please see below for more detail

To Reproduce
When searching using Link feature, the result list always shows the previous state instead of latest state.
In the video below, it should be the same as the text display.
https://recordit.co/4FkA50ZXec

Expected behavior
The result should be updated with the latest state.

Version
^11.0.0-4

Device

  • OS: MacOS
  • Browser: Chrome
  • Version: 85.0.4183.83 (Official Build) (64-bit)

Thank you!

@hoantran-it hoantran-it added the bug Something isn't working label Sep 23, 2020
@hoantran-it hoantran-it changed the title onSearchLink does not render latest result onSearchLink does not render latest state Sep 23, 2020
@hoantran-it hoantran-it changed the title onSearchLink does not render latest state onSearchLink does not render with latest state Sep 23, 2020
@tommoor
Copy link
Member

tommoor commented Sep 25, 2020

I believe we were seeing a race condition in API responses, please try v11.0.0-8 which includes a fix for this and see if it performs better.

If you're still seeing the issue I think it might be in your own code in the way that the API requests are handled – I'd suggest putting together a minimal reproduction.

@hoantran-it
Copy link
Author

hoantran-it commented Sep 25, 2020

@tommoor I tried with v11.0.0-8 but no luck, the problem here is I passed the same data to the display text and rich-markdown-editor but rich-markdown-editor always render the previous data. Could you please give me any advice? Thank you!

Screen Shot 2020-09-25 at 12 40 13

Screen Shot 2020-09-25 at 12 42 26

@tommoor
Copy link
Member

tommoor commented Sep 25, 2020

Your async function does not await the result of the search so this is why it's out of date.

It almost seems like you're treating it similar to a hook. I would expect your setKeyword(term) to be awaited and return the relevant results.

@hoantran-it
Copy link
Author

hoantran-it commented Sep 25, 2020

Thanks @tommoor let me try!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants