Undo manager shared between two instances
See original GitHub issueProblem
- AceEditor component is rendered
- State change causes the AceEditor component to re-render with new name and value (switched from one tab to another in a parent component, for example)
- Undo reverts code back to the value in the previous render
Sample code to reproduce your issue
Make a change in the editor. Go to the next tab. Make another change. Undo.
constructor() {
this.state = {
tabId: 0
};
}
render() {
const { tabId } = this.state;
return (
<div>
<AceEditor name={tabId} mode="javascript" />
<button onClick={() => this.setState({ tabId: this.state.tabId + 1 })}>Next tab</button>
</div>
);
}
Expected behavior
I would expect the undo manager to only undo changes for the editor session I am currently seeing, and for it not to undo changes from previous editor sessions.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Multiple Undo Managers in Cocoa? - swift - Stack Overflow
Every view is a responder. A responder has an undoManager property. So it's just a question of how the responder chain is structured....
Read more >undoManager | Apple Developer Documentation
Instance Property. undoManager. Returns the nearest shared undo manager in the responder chain. iOS 3.0+ iPadOS 3.0+ Mac Catalyst 13.1+ tvOS 9.0+ ...
Read more >Local Undo Mode in Oracle Database 12c Release 2 (12.2)
This new undo management mechanism is called local undo mode, whilst that of previous releases is now known as shared undo mode.
Read more >Single UndoManager Multiple Code/RichText Editors
All editor bindings accept a undoManager option that allows you to define a custom undo manager. You just need to make sure that...
Read more >Why the sepaete undo is required for separate instance?
2 ) One Big Undo tablespace for all RAC instances ... As undo & redo are stored on shared storage, if one instance...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It looks like the Ace component has no logic to handle a
name
changehttps://github.com/securingsincity/react-ace/blob/master/src/ace.js
I’m not sure how React would handle this, but maybe you can force an update by using the
key
attribute?Hi all given it’s been quite some time and no activity on this issue, I am closing it.