Skip to content

CollectionView SelectionChangedCommand Not Fired Inside SfTabView in Syncfusion.Maui.Toolkit v1.0.6 #251

@jjosephjoshy

Description

@jjosephjoshy

Description

When using a .NET MAUI CollectionView inside a Syncfusion.Maui.Toolkit.TabView (SfTabView), the SelectionChangedCommand binding does not fire after updating to Syncfusion.Maui.Toolkit v1.0.6. This breaks MVVM selection logic.

XAML:
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:sftab="clr-namespace:Syncfusion.Maui.Toolkit.TabView;assembly=Syncfusion.Maui.Toolkit" xmlns:local="clr-namespace:MinimalRepro" x:Class="MinimalRepro.MainPage" x:DataType="local:MainViewModel"> <sftab:SfTabView> <sftab:SfTabItem Header="Tab"> <sftab:SfTabItem.Content> <CollectionView ItemsSource="{Binding Items}" SelectionChangedCommand="{Binding SelectionChangedCommand}" /> </sftab:SfTabItem.Content> </sftab:SfTabItem> </sftab:SfTabView> </ContentPage>

ViewModel:

public class MainViewModel
{
    public ObservableCollection<string> Items { get; } = new() { "A", "B", "C" };
    public ICommand SelectionChangedCommand { get; }

      public MainViewModel()
      {
          SelectionChangedCommand = new Command<object>(OnSelectionChanged);
      }
  
      private void OnSelectionChanged(object obj)
      {
          // This is never called in v1.0.6 when inside SfTabView
          Debug.WriteLine("SelectionChanged fired");
      }
}

Expected:

  • SelectionChangedCommand should fire when an item is selected.

Actual:
Command is not called when CollectionView is inside SfTabView.

Steps to Reproduce

  1. Create a new .NET MAUI app.
  2. Add Syncfusion.Maui.Toolkit v1.0.6.
  3. Use the above XAML and ViewModel.
  4. Run the app and select an item in the CollectionView.
  5. Observe that SelectionChangedCommand is not called.

Version with bug

1.0.4

Is this a regression from previous behavior?

Yes, this used to work

Last Known Working Version

1.0.3

Affected platforms

iOS

Affected Platform Versions

No response

Have you found a workaround?

No response

Relevant log output

Metadata

Metadata

Labels

bugSomething isn't working

Type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions