Skip to content

Commit

Permalink
feat(anchor): add selected field for anchor selection change event
Browse files Browse the repository at this point in the history
  • Loading branch information
Antamansid committed Nov 25, 2024
1 parent 61a7f25 commit 49b9c10
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/store/block/BlocksList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ declare module "../../graphEvents" {
event: CustomEvent<{
/** Block anchor */
anchor: TAnchor;
/** Is anchor selected */
selected: boolean;
}>
) => void;

Expand Down Expand Up @@ -124,7 +126,7 @@ export class BlockListStore {
}

if (selected !== anchor.$selected.value) {
this.graph.executеDefaultEventAction("block-anchor-selection-change", { anchor: anchor.asTAnchor() }, () => {
this.graph.executеDefaultEventAction("block-anchor-selection-change", { anchor: anchor.asTAnchor(), selected }, () => {
const currentSelected = this.$selectedAnchor.value;
if (currentSelected && currentSelected !== anchor) {
currentSelected.setSelection(false, true);
Expand Down

0 comments on commit 49b9c10

Please sign in to comment.