EditorView decoration clearing

I have a ViewPlugin defined as ViewPlugin.fromClass in which I provide a set of decorations, and those change on mouse events. I want to clear all of the decorations on mouseout, so I set Decorations to Decoration.none, but CM6 doesn’t always call request for new Decorations which is defined in decorations method of my ViewPlugin. Is there a way to force Decorations request? Or clear the decorations for EditorView?

Just changing the properties of a view plugin will not automatically cause the editor view to update itself (it has no way to even observe such a mutation), but you can call EditorView.update([]) to force an update, or, if this is part of a larger update, dispatch a transaction with some annotation on it that your plugin recognizes, and reset the decorations that way.

1 Like

Thank you @marijn i had something else triggering update, but it wasn’t forcing. Now everything works as expected