This repository was archived by the owner on May 5, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
packages/plugin-dom-layout/src Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import {
16
16
DomObjectRenderingEngine ,
17
17
} from '../../plugin-renderer-dom-object/src/DomObjectRenderingEngine' ;
18
18
import { TagNode } from '../../core/src/VNodes/TagNode' ;
19
- import { flat , isContentEditable } from '../../utils/src/utils' ;
19
+ import { flat , isContentEditable , nodeName } from '../../utils/src/utils' ;
20
20
import { Modifier } from '../../core/src/Modifier' ;
21
21
import { RenderingEngineCache } from '../../plugin-renderer/src/RenderingEngineCache' ;
22
22
import { ChangesLocations } from '../../core/src/Memory/Memory' ;
@@ -608,6 +608,14 @@ export class DomLayoutEngine extends LayoutEngine {
608
608
private _renderSelection ( ) : void {
609
609
const selection = this . editor . selection ;
610
610
const range = selection . range ;
611
+
612
+ const activeNodeName = document . activeElement && nodeName ( document . activeElement ) ;
613
+ if ( activeNodeName === 'INPUT' || activeNodeName === 'TEXTAREA' ) {
614
+ // Do not change the selection if the focus is set within an input
615
+ // or a textarea so as not to lose that focus.
616
+ return ;
617
+ }
618
+
611
619
if ( selection . range . isCollapsed ( ) ) {
612
620
// Prevent rendering a collapsed selection in a non-editable context.
613
621
const target =
You can’t perform that action at this time.
0 commit comments