File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
roosterjs-content-model-core/lib/corePlugin/selection
roosterjs-content-model-plugins/lib/edit Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -559,6 +559,10 @@ class SelectionPlugin implements PluginWithState<SelectionPluginState> {
559559
560560 range . setStart ( posStart . node , posStart . offset ) ;
561561 range . setEnd ( posEnd . node , posEnd . offset ) ;
562+
563+ if ( range . toString ( ) === '' ) {
564+ range . collapse ( true /* toStart */ ) ;
565+ }
562566 } else {
563567 // Get deepest editable position in the cell
564568 const { node, offset } = normalizePos ( cell , nodeOffset ) ;
Original file line number Diff line number Diff line change @@ -177,9 +177,7 @@ export class EditPlugin implements EditorPlugin {
177177 ) {
178178 const selection = this . editor . getDOMSelection ( ) ;
179179 const startContainer =
180- selection ?. type == 'range' && selection . range . collapsed
181- ? selection . range . startContainer
182- : null ;
180+ selection ?. type == 'range' ? selection . range . startContainer : null ;
183181 const table = startContainer
184182 ? this . editor . getDOMHelper ( ) . findClosestElementAncestor ( startContainer , 'table' )
185183 : null ;
@@ -320,4 +318,4 @@ export class EditPlugin implements EditorPlugin {
320318 return false ;
321319 }
322320 }
323- }
321+ }
You can’t perform that action at this time.
0 commit comments