feat!: change gestures to look at selected when dragging (#7991)

* feat: change gestures to look at selected when dragging

* chore: fix tests

* chore: format

* chore: PR comments
This commit is contained in:
Beka Westberg
2024-04-04 15:52:43 +00:00
committed by GitHub
parent e75a4fb1d3
commit ed403d0b77
14 changed files with 88 additions and 200 deletions

View File

@@ -29,6 +29,7 @@ import * as WidgetDiv from './widgetdiv.js';
import {WorkspaceCommentSvg} from './workspace_comment_svg.js';
import type {WorkspaceSvg} from './workspace_svg.js';
import * as Xml from './xml.js';
import * as common from './common.js';
/**
* Which block is the context menu attached to?
@@ -261,7 +262,7 @@ export function callbackFactory(
if (eventUtils.isEnabled() && !newBlock.isShadow()) {
eventUtils.fire(new (eventUtils.get(eventUtils.BLOCK_CREATE))(newBlock));
}
newBlock.select();
common.setSelected(newBlock);
return newBlock;
};
}
@@ -374,7 +375,7 @@ export function workspaceCommentOption(
if (ws.rendered) {
comment.initSvg();
comment.render();
comment.select();
common.setSelected(comment);
}
}