Weird selection issues in Firefox with multiple editors

I use multiple editors on a single page. One of them is editable, and the others are not editable. When the editable editor has focus, I can’t select text from the other editors in Firefox. I have a minimal setup where you can test it out too. Any help is appreciated!

Reproduction steps

  • Open this StackBlitz example in Firefox.
  • The editor that is editable should be focused already. If not, give it focus.
  • Try to select text from either of the non-editable editors. It will not work unless you first blur focus from the editable editor.

What happens is that the other editors aren’t focusable, and calling .focus() on it seems, in Firefox, to not remove focus from another focused element, which also seems to have the effect of restricting the DOM selection to stay in the other editor. This patch make the library explicitly blur other focused elements in this situation.

1 Like

It looks like that patch fixes it for me!