fix(editor): range sync in lit portal (#11490)

Closes: BS-3032
This commit is contained in:
Saul-Mirone
2025-04-07 05:38:20 +00:00
parent 53dff7a158
commit c306d98370

View File

@@ -2,6 +2,7 @@ import type { BaseSelection, BlockModel } from '@blocksuite/store';
import throttle from 'lodash-es/throttle';
import { TextSelection } from '../../selection/index.js';
import { EditorHost } from '../../view/index.js';
import { isActiveInEditor } from './active.js';
import { RANGE_SYNC_EXCLUDE_ATTR } from './consts.js';
import type { RangeManager } from './range-manager.js';
@@ -191,6 +192,11 @@ export class RangeBinding {
return;
}
// From legacy render lit portal
if (range.commonAncestorContainer instanceof EditorHost) {
return;
}
// range is in a non-editable element
// ex. placeholder
const isRangeOutNotEditable =