From b0b15f208f8d0bb16e13d98b0ca6682f4cbb8d97 Mon Sep 17 00:00:00 2001 From: Francis Meng Date: Wed, 5 Jun 2024 15:46:19 -0700 Subject: [PATCH] Add api check --- .../lib/coreApi/setContentModel/setContentModel.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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();