fix: color menu not showing when the cursor was placed in the end of line

This commit is contained in:
kotaindah55 2025-03-07 13:59:47 +02:00
parent 6b3e92aa04
commit 3c27c28167

View file

@ -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) => {