fix: 鼠标从特定被禁用的控件上移开不会使 Tooltip 消失(Meloong-Git/PCL#8882,@MovTery)

This commit is contained in:
龙腾猫跃 committed 2026-07-03 14:03:18 +08:00
1 parent da5069856e
commit 1ee19b4023
1 file changed
+5 -1
+5 -1
View File
@@ -195,7 +195,11 @@ public static class ModernTooltipService {
return;
}
if (owner is not null) BeginShow(owner, Mouse.GetPosition(owner));
if (owner is not null) {
BeginShow(owner, Mouse.GetPosition(owner));
} else if (currentOwner is { IsEnabled: false }) {
Close(true); // 禁用的控件不会触发 MouseLeave,需要由其他元素收到的 MouseMove 主动关闭
}
}
private static FrameworkElement? FindCurrentTooltipOwner(FrameworkElement reference) {