Skip to content

Commit

Permalink
fix(multi editor): clear selection
Browse files Browse the repository at this point in the history
clear selection when switching editors
#60
  • Loading branch information
cycleccc committed Aug 3, 2024
1 parent a1c0ea5 commit b7b2fe7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/core/src/text-area/syncSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ export function DOMSelectionToEditor(textarea: TextArea, editor: IDomEditor) {
IS_FOCUSED.set(editor, true)
} else {
IS_FOCUSED.delete(editor)
Transforms.deselect(editor)
return
}

if (!domSelection) {
Expand Down
2 changes: 1 addition & 1 deletion packages/table-module/src/module/with-selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function withSelection<T extends Editor>(editor: T) {
})

if (!fromEntry || !toEntry) {
// TableCursor.unselect(editor)
TableCursor.unselect(editor)
return apply(op)
}

Expand Down

0 comments on commit b7b2fe7

Please sign in to comment.