feat: cache last selected item when provided

This commit is contained in:
kotaindah55 2025-03-07 13:53:54 +02:00
parent eca8b359f2
commit bb47d81e7a

View file

@ -55,7 +55,8 @@ export class ColorMenu extends Menu {
});
});
}
showMenu() {
showMenu(offset?: number) {
this.checkItemIndexCache();
this.view.requestMeasure({
read: (view) => {
let app = view.state.facet(appFacet.reader),
@ -72,6 +73,7 @@ export class ColorMenu extends Menu {
menuCoords.y += canvasNodeCoords.y;
}
this.showAtPosition(menuCoords);
this.select(this.itemIndexCache.number);
}
}
});