So I’m trying to make my own toolbar in React. I’m using prosemirror-example-setup and prosemirror-menu and trying to copy bits and pieces from there. I’m using ClojureScript so not sure if any code snippets might be useful to anyone else
I’m seeing two issues that might be related:
- My bold/strong button is never “active”. The
markActive
function which is a literal copy of the one in prosemirror-example-setup/menu.js at master · ProseMirror/prosemirror-example-setup · GitHub returns false. - Whenever I click the bold button, I see the marks applied to the text nodes, but never un-applied; as a second press of the toolbar will add another mark.
Whenever I use cmd-b it toggles/untoggles the selection as expected, but it seems like it’s in its own parallel universe. I was suspicious that the React integration (via use-prosemirror) would be at blame but I have verified that the state available via that is the same as the state accessible via view.state.
Any pointers on how to debug this would be helpful.