Description
- .NET Version: 6.0.100
- Windows version: 21H1 (19043.1165)
- Does the bug reproduce also in WPF for .NET Framework 4.8?: Not checked
Problem description:
After upgrading a WPF app from .NET 5 (SDK 5.0.402) to .NET 6, new tooltips are no longer shown without delay when leaving a UI element by mouse for which a tooltip is currently open.
See the following XAML:
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<Button Content="Button 1"
ToolTip="Button 1 tooltip"
ToolTipService.Placement="MousePoint"
ToolTipService.VerticalOffset="-50"
ToolTipService.HorizontalOffset="-45"
ToolTipService.InitialShowDelay="1000"
ToolTipService.BetweenShowDelay="1000"
ToolTipService.ShowDuration="4000"/>
<Button Content="Button 2"
ToolTip="Button 2 tooltip"
ToolTipService.Placement="MousePoint"
ToolTipService.VerticalOffset="-50"
ToolTipService.HorizontalOffset="-45"
ToolTipService.InitialShowDelay="1000"
ToolTipService.BetweenShowDelay="1000"
ToolTipService.ShowDuration="4000"/>
</StackPanel>
And the resulting tooltip behavior for both .NET 5 and .NET 6:
.NET 5 | .NET 6 |
---|---|
![]() |
![]() |
As you can see, the tooltip for "Button 2" is no longer shown immediately after entering it with the mouse as it does in the .NET 5 app. This is especially problematic in an app which uses a (WinUI-styled) NumberBox control with two adjacent spinner buttons both with their own tooltips (such as "Increase/Decrease by 0.1"):
I suspect this behavior change was introduced by the tooltip work for .NET 6, i.e. in PR #4623. Is this behavior change intended or is this a bug? Personally, this looks like a bug to me as it negatively affects the user experience in my view. The tooltip for "Button 1" should no longer be shown when the mouse enters "Button 2" which has its own tooltip - and which should show immediately based on the ToolTipService.BetweenShowDelay
setting.
@SamBent FYI as you worked on the tooltip changes for .NET 6.
Expected behavior:
Same as in .NET 5.
Minimal repro:
WPF issue.zip (Just change the framework from .NET 5 to .NET 6 to see the .NET 6 behavior.)