diff --git a/packages/canvas/container/src/container.ts b/packages/canvas/container/src/container.ts index 9a5fc88e58..23bbfe80be 100644 --- a/packages/canvas/container/src/container.ts +++ b/packages/canvas/container/src/container.ts @@ -468,9 +468,12 @@ const setSelectRect = ( const getElementDurationTime = (elementId?: string) => { const element = elementId ? querySelectById(elementId) : getDocument().body + let delayTime = 50 + if (!element) { + return delayTime + } const transitionDuration = window.getComputedStyle(element).getPropertyValue('transition-duration') const transitionDelay = window.getComputedStyle(element).getPropertyValue('transition-delay') - let delayTime = 0 const getMaxMillisecondNumber = (arr: string[]) => { const millisecondNumber = arr.map((item) => { const unit = item.slice(-2) @@ -491,7 +494,7 @@ const getElementDurationTime = (elementId?: string) => { const transitionDelays = transitionDelay.split(',') delayTime += getMaxMillisecondNumber(transitionDelays) } - return delayTime === 0 ? 300 : delayTime + return delayTime } export const updateRect = (id?: string) => {