Incorrect selection behavior for inline decorations using img/input node

Hi, I am using Decoration.inline and changing the nodeName to img/input(type=button). When doing this the selection is not behaving correctly when moving the cursor near the decoration.

Here is a demo. Steps to reproduce:

  1. Click anywhere in the editor
  2. Try to move the cursor with the arrow keys near the button

This behavior was working correctly before version 1.17.0 of prosermirror-view.

Why am I doing this? It is super useful to decorate text patterns as UI elements like [+] to checkbox.

You can’t use an inline decoration to make something a button. The cursor cannot be placed inside of it, causing issues like what you saw here.

Thank you for the answer. I will use widgets instead.