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 {
1616 DomObjectRenderingEngine ,
1717} from '../../plugin-renderer-dom-object/src/DomObjectRenderingEngine' ;
1818import { TagNode } from '../../core/src/VNodes/TagNode' ;
19- import { flat , isContentEditable } from '../../utils/src/utils' ;
19+ import { flat , isContentEditable , nodeName } from '../../utils/src/utils' ;
2020import { Modifier } from '../../core/src/Modifier' ;
2121import { RenderingEngineCache } from '../../plugin-renderer/src/RenderingEngineCache' ;
2222import { ChangesLocations } from '../../core/src/Memory/Memory' ;
@@ -608,6 +608,14 @@ export class DomLayoutEngine extends LayoutEngine {
608608 private _renderSelection ( ) : void {
609609 const selection = this . editor . selection ;
610610 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+
611619 if ( selection . range . isCollapsed ( ) ) {
612620 // Prevent rendering a collapsed selection in a non-editable context.
613621 const target =
You can’t perform that action at this time.
0 commit comments