Hii, I’m pretty new to Prosemirror. I want to update the marks applied to a selection. The approach I have undertaken is toggling it back to the previous state(with toggleMark) and then toggling it to the new state with the updated marks.
toggleMark(schema.marks.colorPicker)(state, dispatch);
toggleMark(schema.marks.colorPicker, { fontColor })(state,dispatch,);
But it’s throwing this error [RangeError: Applying a mismatched transaction] which I assume due to the state in the function body being stale. I think I am looking for the solution to multiple toggleMark() dispatches in one go. If anything strikes as erroneous or you have any suggestions please let me know.
Thank you!