amwx/FluentAvalonia

Inconsistent tooltip updates for NavigationView MenuItems with data binding

Closed this issue · 3 comments

Describe the bug
When binding an observable collection to a hierarchical menu, the Tooltips for child menu items exhibit inconsistent behavior.

The Tooltips do not update correctly for the children menu items, displaying different behavior when the NavigationView is expanded or collapsed as shown in the bellow GIF

Screenshots

Desktop/Platform (please complete the following information):

  • OS: Windows 11
  • FluentAvalonia Version : 2.0.4 (latest)
  • Avalonia Version : 11.0.6

Additional context

A minimal reproduction of the issue is available here : https://github.com/Coloris/FluentAvaloniaNavViewTooltipIssue

Is there a more efficient or recommended approach to achieve hierarchical menu binding ?

amwx commented

I wonder if this is an issue with ToolTips in Avalonia. Hierarchical NavView is nested ItemsRepeaters, and it looks like when the pane is expanded, we're getting the ToolTip from the top-level item for some reason rather than the lowest in the visual tree. I don't remember this occurring before either, but I can't remember how much I've tested tooltips. The fact that the header text and icons update mean the DataContext is correct,

Just testing with some nested containers:

<Panel ToolTip.Tip="Outer Panel"
       Background="White">
    <Grid Margin="100" 
          Background="Red"
          ToolTip.Tip="Inner Panel">
        <Button Content="hi"
                ToolTip.Tip="hello" />
    </Grid>
</Panel>

And there are some oddities with ToolTips going on - not closing, and I did get the wrong tooltip over the button at least once.

FA is still on Avalonia 11.0.4, but if you're sample project is on 11.0.6 and still having issues, I don't think this has been fixed - or if it has has not been released yet. Would be worth raising this issue upstream and see if its been caught/fixed or just put it on their radar.

Thanks for your time, took your sample code and created an issue : AvaloniaUI/Avalonia#14201

Edit : Someone created an issue in 2021 for the same behavior, so I don't expect Avalonia to fix it in the near future.

Should I close this issue here @amwx ?

amwx commented

Closing as issue upstream.