diff --git a/build/monaco/package.json b/build/monaco/package.json index 430f2b857c3d9..91ed0c1c9a1b0 100644 --- a/build/monaco/package.json +++ b/build/monaco/package.json @@ -1,7 +1,7 @@ { "name": "monaco-editor-core", "private": true, - "version": "0.55.1-os0.1", + "version": "0.55.1-os1", "description": "A browser based code editor", "author": "Microsoft Corporation", "license": "MIT", diff --git a/src/vs/editor/browser/controller/mouseTarget.ts b/src/vs/editor/browser/controller/mouseTarget.ts index 8256f6b487ce6..a653ecc2a47d5 100644 --- a/src/vs/editor/browser/controller/mouseTarget.ts +++ b/src/vs/editor/browser/controller/mouseTarget.ts @@ -1172,8 +1172,13 @@ function shadowCaretRangeFromPoint(shadowRoot: ShadowRoot, x: number, y: number) } // Creates a range with the text node of the element and set the offset found - range.setStart(el.firstChild!, offset); - range.setEnd(el.firstChild!, offset); + if (el.firstChild!.nodeType === Node.TEXT_NODE) { + range.setStart(el.firstChild!, offset); + range.setEnd(el.firstChild!, offset); + } else { + range.setStart(el!, 0); + range.setEnd(el!, 0); + } } return range;