Skip to content

Commit 08b31e7

Browse files
authored
Merge pull request #22 from gravity-ui/feat_add_selected_field_for_anchor_selection_change_event
feat(anchor): add selected field for anchor selection change event
2 parents bcba26c + 49b9c10 commit 08b31e7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/store/block/BlocksList.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ declare module "../../graphEvents" {
3434
event: CustomEvent<{
3535
/** Block anchor */
3636
anchor: TAnchor;
37+
/** Is anchor selected */
38+
selected: boolean;
3739
}>
3840
) => void;
3941

@@ -124,7 +126,7 @@ export class BlockListStore {
124126
}
125127

126128
if (selected !== anchor.$selected.value) {
127-
this.graph.executеDefaultEventAction("block-anchor-selection-change", { anchor: anchor.asTAnchor() }, () => {
129+
this.graph.executеDefaultEventAction("block-anchor-selection-change", { anchor: anchor.asTAnchor(), selected }, () => {
128130
const currentSelected = this.$selectedAnchor.value;
129131
if (currentSelected && currentSelected !== anchor) {
130132
currentSelected.setSelection(false, true);

0 commit comments

Comments
 (0)