Fix/element not found v2.7:Add condition for when element is null#1690
Fix/element not found v2.7:Add condition for when element is null#1690betterdancing wants to merge 2 commits intoopentiny:release/v2.7.xfrom
Conversation
WalkthroughThe Changes
Sequence DiagramsequenceDiagram
participant Caller
participant getElementDurationTime
participant DOM
rect rgb(240, 248, 255)
Note over Caller,DOM: Old Behavior (no early return)
Caller->>getElementDurationTime: query element
getElementDurationTime->>DOM: find element
DOM-->>getElementDurationTime: not found (null)
getElementDurationTime->>getElementDurationTime: proceed with duration computation
getElementDurationTime-->>Caller: computed value
end
rect rgb(230, 245, 220)
Note over Caller,DOM: New Behavior (with early return)
Caller->>getElementDurationTime: query element
getElementDurationTime->>DOM: find element
DOM-->>getElementDurationTime: not found (null)
getElementDurationTime-->>Caller: return 50ms (default)
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/canvas/container/src/container.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: gene9831
Repo: opentiny/tiny-engine PR: 1041
File: packages/plugins/datasource/src/DataSourceList.vue:138-138
Timestamp: 2025-01-14T10:06:25.508Z
Learning: PR #1041 in opentiny/tiny-engine is specifically for reverting Prettier v3 formatting to v2, without any logical code changes or syntax improvements.
📚 Learning: 2025-01-14T08:45:57.032Z
Learnt from: rhlin
Repo: opentiny/tiny-engine PR: 1011
File: packages/canvas/render/src/application-function/global-state.ts:12-25
Timestamp: 2025-01-14T08:45:57.032Z
Learning: The code in `packages/canvas/render/src/application-function/global-state.ts` is migrated from an existing codebase and should be handled with care when making modifications.
Applied to files:
packages/canvas/container/src/container.ts
📚 Learning: 2025-01-14T08:44:09.485Z
Learnt from: rhlin
Repo: opentiny/tiny-engine PR: 1011
File: packages/canvas/render/src/canvas-function/controller.ts:1-7
Timestamp: 2025-01-14T08:44:09.485Z
Learning: Type safety improvements for the controller in `packages/canvas/render/src/canvas-function/controller.ts` should be deferred until the data structure is finalized.
Applied to files:
packages/canvas/container/src/container.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: push-check
English | 简体中文
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Background and solution
场景:当画布上元素大小变化时(如按钮大小变化)会有一个过渡动画,但选中的边框是立即检测元素变化,导致边框和组件边缘不重合,因此需要通过getElementById获取组件的animation delay
What is the current behavior?
elementId存在但是找不到对应的element元素,例如teleport 或者是 顶层是 fragment 的元素
Issue Number: N/A
What is the new behavior?
如果在elementId找不到对应的元素,则直接return默认的delay毫秒50ms
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit