From 3c27c28167a033181094972df7f902026fbdbda8 Mon Sep 17 00:00:00 2001 From: kotaindah55 Date: Fri, 7 Mar 2025 13:59:47 +0200 Subject: [PATCH] fix: color menu not showing when the cursor was placed in the end of line --- src/editor-mode/ui-components/ColorMenu.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/editor-mode/ui-components/ColorMenu.ts b/src/editor-mode/ui-components/ColorMenu.ts index 4ddeb35..359e7da 100644 --- a/src/editor-mode/ui-components/ColorMenu.ts +++ b/src/editor-mode/ui-components/ColorMenu.ts @@ -63,7 +63,10 @@ export class ColorMenu extends Menu { read: (view) => { let app = view.state.facet(appFacet.reader), canvasNodeCoords = getActiveCanvasNodeCoords(app), - charCoords = view.coordsForChar(this.tagRange.from); + charCoords = view.coordsForChar((offset ?? this.tagRange.from)); + if (offset !== undefined && !charCoords) { + charCoords = view.coordsForChar(offset - 1); + } return { charCoords, canvasNodeCoords }; }, write: (measure) => {