I think this happens because the browser finds no element that is contentEditable and so it freaks out. An alternative solution is to enable document.designMode in Firefox, but there might have other unintended consequences so I decided not to go down that route.
This is a pretty obscure but that occurs only in Firefox when the editor view is disabled.
Specifically, this code causes an
NS_ERROR_FAILURE
to be thrown:I think this happens because the browser finds no element that is
contentEditable
and so it freaks out. An alternative solution is to enabledocument.designMode
in Firefox, but there might have other unintended consequences so I decided not to go down that route.