diff --git a/packages/roosterjs-content-model-core/lib/coreApi/setContentModel/setContentModel.ts b/packages/roosterjs-content-model-core/lib/coreApi/setContentModel/setContentModel.ts index 143fad26d1a..f7a62e2377d 100644 --- a/packages/roosterjs-content-model-core/lib/coreApi/setContentModel/setContentModel.ts +++ b/packages/roosterjs-content-model-core/lib/coreApi/setContentModel/setContentModel.ts @@ -20,7 +20,7 @@ export const setContentModel: SetContentModel = (core, model, option, onNodeCrea const editorContext = core.api.createEditorContext(core, true /*saveIndex*/); if (option?.shouldMaintainSelection) { - if (CSS.highlights && Highlight) { + if ('highlights' in CSS && Highlight) { const selectionEl = document.querySelector(SelectionSelector); if (selectionEl && selectionEl.textContent) { const textRange = new Range();