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

Pass data to custom tools after editor initialization #202

Open
eladkarakuli opened this issue Jun 28, 2021 · 3 comments
Open

Pass data to custom tools after editor initialization #202

eladkarakuli opened this issue Jun 28, 2021 · 3 comments

Comments

@eladkarakuli
Copy link

eladkarakuli commented Jun 28, 2021

Hi,

I'm building a custom tool much like the product library custom tool
But, in order to paginate, search and show available products I would like to be able to pass and change the data after the initialization of the editor

there's a clear way to pass data to a custom tool
but it seems that there's no way to update or pass again different data after the initialization

Thank you very much

@faizan-ali
Copy link

@eladkarakuli Hmm that's an interesting problem.
You could trigger a forced re-render of the Editor component whenever the data is updated in order to reflect the changes? This would mean holding editor state in some sort of wrapper component around the editor (so you don't lose it on re-render) and managing it via the design:updated event listener.

@gdvalderrama
Copy link

The problem is not re-rendering, the problem is being able to paginate through a list API endpoint.
Say your product custom tool had thousands of products, how could we go about allowing the user to search for those products and insert any of them?

It's unrealistic to expect an API to return all products without pagination, but data can only be passed when initializing, and will not contain all products.

@Drashti-Shah
Copy link

did anyone find the solution to this issue?

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

4 participants