Skip to content
This repository has been archived by the owner on May 3, 2023. It is now read-only.

Undo/Redo : custom events #53

Closed
JohnCyberWick opened this issue May 21, 2021 · 4 comments
Closed

Undo/Redo : custom events #53

JohnCyberWick opened this issue May 21, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@JohnCyberWick
Copy link

Hello,

I've been recently using your cool library and I noticed that when I use the undo/redo feature, it seems that only some events are kept in memory : node creation, edge creation and delete item.

I have custom nodes that have an internal HTML input with a default value.
Whenever the user changes the input value a custom event is dispatched.
Internally, a custom reducer catches the event then updates the node's consumerData with the new value.
Unfortunately, after an undo/redo, the value is back to the default one.

I don't know if this is the intended behavior. I would like to be able to keep the last value set.

Best regards

@JohnCyberWick JohnCyberWick added the enhancement New feature or request label May 21, 2021
@sameergoyal
Copy link
Contributor

Apologies for the delay in our response.

It is a good suggestion for enhancement. Would you be willing to submit a PR for this?

This could be achieved by exposing an additional configuration option and hooking the consumer provided logic here: https://github.com/awslabs/diagram-maker/blob/master/src/state/middleware/undoMiddleware.ts#L10-L27

@JohnCyberWick
Copy link
Author

Thanks for your response,

I'm willing to submit a PR but I can't give you a clear estimate right now. Among all the issues I opened, this one would be the first on my "todolist".

@sameergoyal
Copy link
Contributor

Thanks for contributing back.

Let us know if you need additional guidance on how to implement this change.

@tracy-french
Copy link
Contributor

Sorry, we are not planning to act on this request in any timely manner and will be closing this issue. Thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants