wpfui icon indicating copy to clipboard operation
wpfui copied to clipboard

Align AutoSuggestBox with SearchTextBox's behavior in the default Windows 11 Fluent-enabled app

Open danielkornev opened this issue 3 years ago • 0 comments
trafficstars

Is your feature request related to a problem? Please describe. In Windows 11, Search text box operates in the following manner:

  1. User types text into the search box
  2. User clicks on search button
  3. System performs search and shows results

However, AutoSuggestBox while looking similar to the Search Box in various Fluent UI-based apps behaves differently:

  1. User types text into the search box
  2. If system has no auto-suggestions for this box, QuerySubmitted event never fires
  3. If system has an auto-suggestions list provided for this box, QuerySubmitted event always fires as long as text changes happened and text query isn't empty

You can see that in apps like Media Player and Settings the behavior differs.

Describe the solution you'd like A better solution would be like this:

Either adapt this control to behave more like a SearchTextBox with enabled auto-suggestions or build a separate SearchTextBox

Desired behavior:

  1. No matter if developer have supplied auto-suggestions or not, control can fire QuerySubmitted event
  2. Control doesn't fire QuerySubmitted event but does it when user clicked on Search button manually or pressed Enter on their keyboard
  3. For backwards compatibility, control can have a new property like SearchMode with the default value set to Immediate, and second one set to Delayed, enabling the aforementioned behavior

Describe alternatives you've considered I've used the really old SearchTextBox originally made for WPF in 2009, and styled it to resemble AutoSuggestBox instead. However it lacks auto-suggestions.

Additional context Love WPFUI!

danielkornev avatar Jul 30 '22 16:07 danielkornev