Selection changes when inline Decoration is applied

Hey, this still seems to be an issue today:

2021-12-20 17-32-56.2021-12-20 17_33_47

I’ve made a simplified example with a prosemirror plugin in tiptap: distracted-fast-j6ucv - CodeSandbox

It happens a bit intermittently, when the decoration is applied while highlighting text, the selection to jumps to the end of the text selection. If decoration is not supposed to work like this, is there any alternative way to add a class to the user selected text?

– Update: if I add this to the plugin, I don’t get this selection issue:

handleDOMEvents: {
            mousedown: (view, event) => {
              return true;
            },
            mouseup: (view, event) => {
              return true;
            }
          },

I’m not sure yet what implications to the rest of my app this will have, but it seems a good workaround for now (try here: eager-shadow-ginr3 - CodeSandbox)

– just tried again, intercepting mousedown isn’t good solution