SfTextBoxExt with autocomplete 'sticks' on screen when ScrollViewer is scrolled and SuggestionBox is open

I have a SfTextBoxExt with AutoComplete nested within a ScrollViewer with multiple other elements so the ScrollViewer can be enabled. When the SuggestionBox is open and I scroll the ScrollViewer with my mouse wheel, the SuggestionBox 'sticks' to the screen instead of closing or following the scroll location. Expected behaviour is that the SuggestionBox stays attached to the SfTextBoxExt when I scroll, or at the very least close instead of remaining open. I've attached a video of the behaviour. 


Attachment: sfAutocompleteProblem_384a93a1.zip

1 Reply

SE Surya Elayaperumal Syncfusion Team January 23, 2025 01:36 PM UTC

Hi Josepth Badrouk,

We have reviewed the query and reproduced the reported issue in the WPF SfTextBoxExt with AutoComplete. The issue occurs because the ScrollViewer's scroll event cannot be detected in the TextBoxExt. As a workaround, the ScrollChanged event can be handled, and the suggestion box's IsDropDownOpen property can be set to false to close the dropdown. Code snippets and a sample file have been provided below for reference. Please confirm the proposed workaround is fine, let us know if you have any concerns.

XAML

<ScrollViewer ScrollChanged="ScrollViewer_ScrollChanged">

      <StackPanel >

          <editors:SfTextBoxExt x:Name="autocomplete" HorizontalAlignment="Center" Margin="50"

                               VerticalAlignment="Center"

                               Width="300"

                               Height="40"

                               SearchItemPath="Name"

                               AutoCompleteMode="Suggest"

                               AutoCompleteSource="{Binding Employees}" />

c#

 

  private void ScrollViewer_ScrollChanged(object sender, ScrollChangedEventArgs e)

  {

      if(autocomplete.IsSuggestionOpen)

      {

          autocomplete.IsSuggestionOpen = false;

      }

  }


Regards,
Surya


Attachment: TextBoxExtStyle_dbc6bfd4.zip

Loader.
Up arrow icon