Skip to content

Comboboxitem tooltip bug #5716

Closed
Closed

Description

@AntonNah
  • .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>

Activity

  1. lindexi commented on Nov 22, 2021

    @lindexi
    Member

    See #4612

  2. singhashish-wpf commented on Nov 23, 2021

    @singhashish-wpf
    Contributor

    @AntonNah Could you please specify the exact .Net Core version you are using?

  3. added
    needs more information
    and removed on Nov 23, 2021
  4. Yoooi0 commented on Nov 24, 2021

    @Yoooi0

    @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.

  5. AntonNah commented on Nov 25, 2021

    @AntonNah
    Author

    Net5 also not correct as seen in the gif.

  6. Yoooi0 commented on Nov 25, 2021

    @Yoooi0

    Net5 also not correct as seen in the gif.

    If you mean that there is a delay I think that should be a different issue.
    You didnt explain anything in the OP so I thought this was about .NET6 tooltip not working at all.

  7. amirburbea commented on Dec 17, 2021

    @amirburbea

    I made a repro of this bug: https://github.com/amirburbea/PopupRepro

    Run this app under .NET 5 and .NET 6 and you'll see that ListBoxItem has no issues with tooltip, but ComboBoxItem does.

  8. cheesi commented on Dec 31, 2021

    @cheesi

    I can confirm this issue with .NET 6.0.101.

  9. removed
    needs more information
    on Jan 4, 2022
  10. cheesi commented on Feb 1, 2022

    @cheesi

    As this is closed now: will this fix be delivered with .NET 6.0.2?

  11. singhashish-wpf commented on Feb 1, 2022

    @singhashish-wpf
    Contributor

    @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.

  12. added a commit that references this issue on Feb 21, 2022
  13. Mgamerz commented on Mar 17, 2022

    @Mgamerz

    Should this be re-opened, since the issue seems to be worse now than it was before, and it's been a servicing release (6.0.3 came out in march)?

  14. Dunge commented on Mar 22, 2022

    @Dunge

    Having the same issue with 6.0.3. Works on my home (Win11) and work (Win10) computer fine, but customer (Win10) recorded a video showing the same behavior on his. Not sure what's the difference between machine to cause the issue, but it was working in NET5 and started showing up when upgrading to NET6. It's happening not just on combobox but on any element with tooltips.

    I believe my customer is having a custom 125% zoom factor applied to his monitor in the Windows options. Might be what's causing it.

    @singhashish-wpf could you take a second look at it?

  15. Mgamerz commented on Mar 23, 2022

    @Mgamerz
  16. lindexi commented on Mar 23, 2022

    @lindexi
    Member

    @Mgamerz Do you means #6289 ?

  17. Mgamerz commented on Mar 23, 2022

    @Mgamerz

    Yes, as well as reports here.

  18. toristorii commented on Mar 24, 2022

    @toristorii

    .NetCore 6.0.3 here and having the same problem with tooltips on pretty much anything, even a button. My scaling set to 150%

    Steps I did to repro:
    Created a new .net core 6 wpf app, in Visual Studio.
    Added a button to the grid in MainWindow.xaml as follows:

    <Button Content="Test" Height="25" Width="100" ToolTip="Hello World"/>

    Run.
    Mouse over the button and 95% of the time it only appears for a fraction of a second.

    Change to .netcore 5 and it works correctly.

    Change back to .netcore 6 and scaling set to 100% and it works correctly too.

  19. ThomasGoulet73 commented on Mar 24, 2022

    @ThomasGoulet73
    Contributor

    @toristorii This is the same issue as #6289, you should follow the status there since closed issues are less likely to receive updates.

  20. jamiehankins commented on Mar 26, 2022

    @jamiehankins

    Not to pile on, but this is causing a lot of heartburn for me.

    Since I went along with "implicit usings" in .NET6, going back to 5 would mean editing a bunch of files. Please tell me you guys are going to fix this soon!

  21. ghost locked as resolved and limited conversation to collaborators on Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions