Search for posts when adding links is potentially VERY slow #26358
Labels
[Feature] Link Editing
Link components (LinkControl, URLInput) and integrations (RichText link formatting)
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
Describe the bug
When you want to add a link to your paragraph block, you will open a small modal where you can search for a post on your site. This searchbox adds a ajax query for every onKeyUp resulting in as many queries as the amount of letters in your search. Since the result will not show until all are finished, this can take a very long time(Especially when there are a lot of posts on your site. 45.000 posts resulted in a search that took well over 30 seconds)
To reproduce
Steps to reproduce the behavior:
Expected behavior
ajax calls that are no longer valid should be aborted when a new one is being called.
Editor version (please complete the following information):
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: