We recently just updated to the newer versions of prosemirror-view, and we’re running into a problem with swaping out plugins. We have two plugins that apply different classNames to the docView => outerDesc. The goal is when you swap plugins, it automatically removes a className, and adds the new className. Doing that currently, keeps both at the same time. It doesn’t purge the className the other plugin was applying, and instead keeps the old one and the className of the added plugin. By swapping I mean there are two changed lists of plugins such that:
List A = […, VerticalPlugin, …];
List B = […, HorizontalPlugin, …];
So the two plugins never exist at the same time, both have different classNames that need to be applied without the presence of the other classNames. I hope this makes sense.
Here is the code where it seems to be ignoring the plugin that was applying this className.
The reason why its not removing the className from the removed plugin, is because this function is passed noDeco, which does not contain the previous list of classes from the previous state.
I’m not sure if there was some critical change that is necessary to purge previous classNames applied through stuff like this:
But, If theres something i’m missing here, please let me know. Because, this used to work before.