diff --git a/wax-prosemirror-core/src/WaxView.js b/wax-prosemirror-core/src/WaxView.js index c6e06b876633e92afb3d775a07996ec74a671848..8af701fd1670a4ca46567875e86b0a6e841d5ee6 100644 --- a/wax-prosemirror-core/src/WaxView.js +++ b/wax-prosemirror-core/src/WaxView.js @@ -61,13 +61,12 @@ export default props => { const dispatchTransaction = transaction => { const { TrackChange } = props; const group = "main"; - const tr = TrackChange - ? trackedTransaction(transaction, view.state, user, group) - : transaction; - const state = view.state.apply(tr); - view.updateState(state); - if (!tr.getMeta("fromOutsideView")) { + /*when a transaction comes from a view other than + main don't keep updating the view ,as this this + the central point of each transaction + */ + if (!transaction.getMeta("fromOutsideView")) { context.updateView( { main: view @@ -75,6 +74,12 @@ export default props => { "main" ); } + const tr = TrackChange + ? trackedTransaction(transaction, view.state, user, group) + : transaction; + + const state = view.state.apply(tr); + view.updateState(state); props.onChange(state.doc.content); }; diff --git a/wax-prosemirror-services/src/NoteService/Editor.js b/wax-prosemirror-services/src/NoteService/Editor.js index 208cf6089d912cd3754542f7212fea7a6fe3f4a7..64a714b469f0f7d576fa57b072dfbb10d4021913 100644 --- a/wax-prosemirror-services/src/NoteService/Editor.js +++ b/wax-prosemirror-services/src/NoteService/Editor.js @@ -42,7 +42,7 @@ export default ({ node, view }) => { //Set everytime the active view into context setTimeout(() => { context.updateView({}, noteId); - }, 200); + }, 20); if (!tr.getMeta("fromOutside")) { let outerTr = view.state.tr,