Skip to main content
Question

Enable a single undo for multiple operations?


Adam_Page

Is it possible for a plugin to “batch” multiple operations (e.g., multiple calls to InstanceNode. setProperties triggered by a single user action in the plugin) into a single undo?

For example, if I’m just using native Figma and I select multiple component instances and then change a property for all of them, a single undo will revert that property change for all the instances simultaneously.

In a plugin I’m developing, I’ve got a feature where I take a single user action (like the press of a button in the plugin UI) and update multiple selected nodes similarly to the example above. However, when the operation completes, each instance has its own undo added to the undo history, making it cumbersome to revert all the property changes.

I’ve found the documentation for commitUndo, but none of my experiments with that function and have given me the “one undo reverts all bulk changes” behavior that I’m looking for. Please help! 😅

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings