TreeView Control arrow keys navigation

Hi,

I believe I have encountered a bug with Syncfusion TreeView Control.

Item selection is lost when using keyboard navigation arrows. 

Steps to reproduce:

  1. Mouse click on a item in the treeview.
  2. Using keyboard press down or up buttons.
  3. Navigation works.
  4. Mouse click on another item in the treeview .
  5. Using keyboard press down or up buttons

Actual Result:

Selection is lost and you cannot navigate using navigation arrows.

Workaround: You have to do another mouse click to be able to navigate using keyboard navigation arrows.

Expected Result:

You don't need to click more than once to maintain navigability through arrow keys. 


Why a bug?
The issue is not encountered when I am using a containing a smaller​ treenode population , but when switching to a largertreenode population this issue is encountered. This occurs in a project of mine, but I have managed to reproduce this issue in a dummy-project that I can share you with. This issue occurs in this project regardless of a large ​treenode population, instead this issue is persistent with a small treenode population.

I have tracked the call stack to where I believe the issue occurs: 
Image_5777_1704810886947
The breakpoint at Line 136 triggers on a keyevent, and in this case syncfusion keydetector responds to this keyevent (navigate with keys work). In turn, ends up at "treeView_SelectionChanged", where a treeview item is changed. 
The breakpoint at line 136 is not triggered in the dummy-project unless "I can navigate", but in my real project this breakpoint is triggered but doesn't move forward to syncfusion keydetector unless "I can navigate"

Attachment: navbug_db10b33e.zip

5 Replies 1 reply marked as answer

SY Suthi Yuvaraj Syncfusion Team January 10, 2024 03:29 PM UTC

Hi David Ellerblad Valtonen,

We have checked the reported query at our end. We are able to reproduce the issue at our end. we are currently validating the issue at our end. we will update you with further details on or before January 16,2024. We will appreciate your patience until then.

Regards,

Suthi Yuvaraj



SY Suthi Yuvaraj Syncfusion Team January 16, 2024 01:40 PM UTC

David Ellerblad Valtonen,

We have analyzed the reported query, we can reported the issue at our end. We have already logged the bug report at our end. We will fix the issue and include the fix in our upcoming Nuget release, which will be available on or before February 13, 2024. We will appreciate your patience until then.


You can also communicate with us regarding the open features at any time using our Feature Report page.    


FeedBack link : https://www.syncfusion.com/feedback/50002/sftreeview-key-navigation-doesnot-works-properly-for-mouse-click


If you have any more specifications/suggestions for the feature request, you can add it as a comment in the portal and cast your vote to make it count.  



DE David Ellerblad Valtonen January 23, 2024 02:43 PM UTC

Hi,

I would like to bring attention to a similar bug that is related to this query. 

If a Button is added to the itemtemplate, the bug is not the same. Instead of losing navigability like described previously, the focus of the treeview is changed. Now, when attempting to navigate using arrow keys, the view is scrolled (scrollbar, even if disabled, is scrolled using the keys, this is not desired behavior), instead of changing the item and navigating. This occurs when there are items that are out of the visible view, to recreate, minimize the application window and/or increase number of treeview-items. 


 <treeView:SfTreeView.ItemTemplate>
     <DataTemplate>
         <ViewCell>
             <Grid x:Name="grid" RowSpacing="0" BackgroundColor="Transparent">
                 <Grid.RowDefinitions>
                     <RowDefinition Height="*" />
                     <RowDefinition Height="1" />
                 </Grid.RowDefinitions>
                 <Grid RowSpacing="0" Grid.Row="0">
                     <Grid.ColumnDefinitions>
                         <ColumnDefinition Width="40" />
                         <ColumnDefinition Width="*" />
                         <ColumnDefinition Width="100" />
                     </Grid.ColumnDefinitions>
                     <Grid Padding="5,5,5,5">
                         <Image Source="{Binding Content.ImageIcon}" VerticalOptions="Center" HorizontalOptions="Center" HeightRequest="15" WidthRequest="15" />
                     </Grid>
                     <Grid Grid.Column="1" RowSpacing="1" Padding="1,0,0,0" VerticalOptions="Center">
                         <Label Text="{Binding Content.ItemName}"/>
                         <Button BackgroundColor="Orange" WidthRequest="10" HeightRequest="10" CornerRadius="0" HorizontalOptions="End"></Button>
                     </Grid>
                 </Grid>
                 <StackLayout Grid.Row="1"
                  HeightRequest="1" />
             </Grid>
         </ViewCell>
     </DataTemplate>
 </treeView:SfTreeView.ItemTemplate>




SY Suthi Yuvaraj Syncfusion Team January 24, 2024 02:56 PM UTC

David Ellerblad Valtonen,


We have checked reported query , we want to inform you that the interactive control was embedded within the SfTreeView. The structure of the SfTreeView consists of a ScrollView and a Container, and the items are contained within the ScrollView. As a result, when an interactive control is placed within the ScrollView, the focus is not transferred to the interactive control's parent,.Hence the scroll happened. We suggest you focus the treeview ,when tapping the button inside the itemTemplate. Please refer to the below code snippet for your reference.


Code snippet:

  private void Button_Clicked_1(object sender, EventArgs e)
  {
      treeView.Focus();
      var data = (sender as Button).BindingContext as FileManager;
      treeView.SelectedItem = data;
  }



SY Suthi Yuvaraj Syncfusion Team February 14, 2024 09:40 AM UTC

David Ellerblad Valtonen,

We have included the fix for the reported issue in our latest weekly NuGet release v24.2.5 which is available for download ( https://www.nuget.org/ ). We thank you for your support and appreciate your patience in waiting for this update. Please get in touch with us if you require any further assistance.


Marked as answer
Loader.
Up arrow icon