From c306d983708781a4d1093a01737d1d19d1918540 Mon Sep 17 00:00:00 2001 From: Saul-Mirone Date: Mon, 7 Apr 2025 05:38:20 +0000 Subject: [PATCH] fix(editor): range sync in lit portal (#11490) Closes: BS-3032 --- blocksuite/framework/std/src/inline/range/range-binding.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/blocksuite/framework/std/src/inline/range/range-binding.ts b/blocksuite/framework/std/src/inline/range/range-binding.ts index e154031e9..22681e998 100644 --- a/blocksuite/framework/std/src/inline/range/range-binding.ts +++ b/blocksuite/framework/std/src/inline/range/range-binding.ts @@ -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 =