Repository navigation
fix: release unique popup ownership on trigger unmount - #649
yulman2207 wants to merge 1 commit into
Conversation
|
@yulman2207 is attempting to deploy a commit to the afc163's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
Walkthrough唯一弹层现在按触发器 ID 管理所有者和延迟操作。触发器卸载时会释放对应 ID。目标状态 hook 支持释放当前或待处理选项。新增测试覆盖卸载、延迟操作和 Provider 隔离。 Changes唯一弹层生命周期
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant Trigger
participant UniqueContext
participant UniqueProvider
participant useTargetState
Trigger->>UniqueContext: 卸载时调用 release(id)
UniqueContext->>UniqueProvider: 转发 release(id)
UniqueProvider->>useTargetState: 调用 releaseTarget(id)
useTargetState-->>UniqueProvider: 返回仍有效的选项 ID
Merge Risk: ⚪ Minimal · up to
|
What changed
Why
With Ant Design's
ConfigProvider tooltip={{ unique: true }}, clicking a button that removes its Tooltip leaves the shared popup visible. The same failure reproduces directly in Trigger: the provider outlives the trigger and previously received no ownership-release notification.Fixes ant-design/ant-design#59603. The fix belongs here rather than in an Ant Design DOM or event workaround. Existing leave animations and cached popup content are preserved.
Validation
npm run tsc: passed.npm run lint: passed with 0 errors and 10 hook-dependency warnings.git diff --check: passed.AI assistance disclosure: this implementation, regression coverage, and PR description were prepared with OpenAI Codex, including a separate code-review pass. Please review the change normally.
Summary by CodeRabbit