From 83a94f07371910b96fd3b3b21304868980f49950 Mon Sep 17 00:00:00 2001 From: AlbertHilb Date: Thu, 30 Mar 2017 16:23:56 +0200 Subject: [PATCH] When editor contains nested editable elements, in some situations, (#693) the focus goes to those elements. In firefox, this causes issues with keyboard navigation and therefore it must be prevented. --- src/components/content.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/content.js b/src/components/content.js index 4f6ff301f..11360f62d 100644 --- a/src/components/content.js +++ b/src/components/content.js @@ -290,6 +290,13 @@ class Content extends React.Component { if (this.props.readOnly) return if (this.tmp.isCopying) return if (!this.isInContentEditable(event)) return + // COMPAT: When editor contains nested editable elements, in some situations, + // the focus goes to those elements. In Firefox, this must be prevented + // because it results in issues with keyboard navigation. (2017/03/30) + if (IS_FIREFOX && event.target !== this.element) { + this.element.focus() + return + } const data = {}