question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Comboboxitem tooltip bug

See original GitHub issue
  • .NET Core Version: NET 6, NET 5
  • Windows version: windiws 10 1803

NET 6 1

NET 5 3

<Grid>
     <ComboBox Width="100" Height="20">
         <ComboBoxItem ToolTip="1">13.42</ComboBoxItem>
         <ComboBoxItem ToolTip="2">15.82</ComboBoxItem>
     </ComboBox>
 </Grid>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:17 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
Yoooi0commented, Nov 24, 2021

@singhashish-wpf I think he got the naming confused, the issue is only happening in .NET6 (6.0.100), in .NET5 (5.0.403) the behavior is correct.

I have the exact same issue but when using Popup’s. I think this is related since ComboBox also uses a Popup. The issue seems to be coming from calling Mouse.Capture(control, CaptureMode.SubTree); on the parent control that owns the popup.

Sample control code:

<UserControl x:Class="WpfIssueControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             MouseLeftButtonDown="UserControl_MouseLeftButtonDown">
    <Grid>
        <ToggleButton x:Name="Button" 
                      Checked="Button_Checked" 
                      Unchecked="Button_Unchecked"/>

        <Popup x:Name="Popup" 
               IsOpen="{Binding IsChecked, ElementName=Button}">
            <Border Background="Gray">
                <TextBlock Text="TextBlock" 
                           ToolTip="ToolTip"
                           ToolTipService.InitialShowDelay="0"/>
            </Border>
        </Popup>
    </Grid>
</UserControl>
public partial class WpfIssueControl : UserControl
{
    public WpfIssueControl() => InitializeComponent();
    private void Button_Checked(object sender, RoutedEventArgs e) => Mouse.Capture(this, CaptureMode.SubTree);
    private void Button_Unchecked(object sender, RoutedEventArgs e) => Mouse.Capture(null);
    private void UserControl_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) => Button.IsChecked = false;
}

Removing the Mouse.Capture(this, CaptureMode.SubTree); call fixes the issue and makes the tooltip behave normally, obviously that is not a proper fix. As in OP the issue only happens when targeting net6.0-windows, switching to net5.0-windows also makes the tooltip behave normally.

2reactions
singhashish-wpfcommented, Feb 1, 2022

@cheesi It is most likely that this will be delivered with the next servicing release for 6.0; This still depends on some other factors, Will keep this posted once there is a confirmation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Displaying a Tooltip for ComboBoxItem - works after ...
The problem is that when I open the Combobox for the first time I don't get the Tooltip... Strange because the method is...
Read more >
NET 6, WPF: the ToolTip doesn't work on ComboBoxItem
Hi, In .NET 6, the tooltip of the ComboBoxItem doesn't work if the ComboBox is inside of a UserControl. It shows up for...
Read more >
ComboBox doesn't show tooltip over its TextField
Place the cursor over the middle of the ComboBox. RESULT: Tooltip is not shown. If you place the mouse over the drop-down button...
Read more >
[RESOLVED] ComboBox Item Tool Tips. 90% Working. ...
So i've got this Combobox with tooltips for each individual item and it 90% works apart from this visual drawing bug.
Read more >
Problems with custom tooltip method, ComboBox
I'm having an issue with my custom tooltip method. It is pretty simple: if isMouseOver() is true for a given component, I get...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found