mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 18:26:05 +08:00
fix: connector issues (#12308)
Fixes [BS-3161](https://linear.app/affine-design/issue/BS-3161/发现已连接的connector会响应对齐线) Fixes [BS-3337](https://linear.app/affine-design/issue/BS-3337/connector你肿么了) Fixes [BS-3334](https://linear.app/affine-design/issue/BS-3334/connector-不应该能够被拖拽) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Corrected typos related to label editing state, ensuring more reliable label editing and display for connectors. - Fixed logic in the auto-complete overlay, improving when overlays appear during hover actions. - **New Features** - Improved connector label handling by ensuring label state is preserved and restored during editing. - Enhanced connector movement behavior, allowing connectors to be moved only when appropriate elements are selected. - **Tests** - Added end-to-end tests to verify connector movement and selection behaviors for improved reliability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -278,7 +278,13 @@ export class ConnectorElementModel extends GfxPrimitiveElementModel<ConnectorEle
|
||||
}
|
||||
|
||||
hasLabel() {
|
||||
return Boolean(!this.lableEditing && this.labelDisplay && this.labelXYWH);
|
||||
return Boolean(
|
||||
!this.labelEditing &&
|
||||
this.labelDisplay &&
|
||||
this.labelXYWH &&
|
||||
this.text &&
|
||||
this.text.length
|
||||
);
|
||||
}
|
||||
|
||||
override includesPoint(
|
||||
@@ -450,7 +456,7 @@ export class ConnectorElementModel extends GfxPrimitiveElementModel<ConnectorEle
|
||||
* Local control display and hide, mainly used in editing scenarios.
|
||||
*/
|
||||
@local()
|
||||
accessor lableEditing: boolean = false;
|
||||
accessor labelEditing: boolean = false;
|
||||
|
||||
@field()
|
||||
accessor mode: ConnectorMode = DEFAULT_CONNECTOR_MODE;
|
||||
|
||||
Reference in New Issue
Block a user