"uncapture" to not edit after blur?

I’ve noticed that if I

  1. select a node
  2. blur the editable
  3. press backspace

the node is still deleted. Is this by design or a bug? Is there a good way to work around it?

How are you blurring the editor? In principle, if you’ve blurred it, it should no longer be focused, so the key event for the backspace isn’t even delivered to the editor’s editable node. (Testing this in Chrome seems to confirm that that’s what happens – backspace does nothing.)

pm.editor.content.blur()

You’ll also have to clear the text selection, for example with window.getSelection().removeAllRanges()

Related to this, why did the PM blur method get removed?

I had some issues where I wanted to blur the editor when a modal was open. My issue was that the editor would continue to capture text input. To achieve a “real” blur, I had to add a hidden input field and now my blur() sets focus to that input field.

Are you sure it ever had one?

Oops, no. :flushed: