From 08db39825c3b5660dda16cab8493e231aaf5e264 Mon Sep 17 00:00:00 2001 From: yvonneyx Date: Wed, 22 May 2024 19:37:05 +0800 Subject: [PATCH] fix: fix cr issue --- packages/g6/src/behaviors/hover-element.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/g6/src/behaviors/hover-element.ts b/packages/g6/src/behaviors/hover-element.ts index 95e6cdbfa2..b8800a335b 100644 --- a/packages/g6/src/behaviors/hover-element.ts +++ b/packages/g6/src/behaviors/hover-element.ts @@ -2,7 +2,7 @@ import { isFunction } from '@antv/util'; import { CommonEvent } from '../constants'; import { ELEMENT_TYPES } from '../constants/element'; import type { RuntimeContext } from '../runtime/types'; -import type { Element, ElementType, ID, IPointerEvent, State } from '../types'; +import type { Element, ElementType, ID, IDragEvent, IPointerEvent, State } from '../types'; import { idsOf } from '../utils/id'; import { getElementNthDegreeIds } from '../utils/relation'; import type { BaseBehaviorOptions } from './base-behavior'; @@ -91,8 +91,8 @@ export class HoverElement extends BaseBehavior { this.bindEvents(); } - private toggleFrozen = () => { - this.isFrozen = !this.isFrozen; + private toggleFrozen = (e: IDragEvent) => { + this.isFrozen = e.type === 'dragstart'; }; private bindEvents() {