File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/Files.App/Actions/Show Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -28,17 +28,17 @@ public ToggleFilterHeaderAction()
28
28
generalSettingsService . PropertyChanged += GeneralSettingsService_PropertyChanged ;
29
29
}
30
30
31
- public Task ExecuteAsync ( object ? parameter = null )
31
+ public async Task ExecuteAsync ( object ? parameter = null )
32
32
{
33
33
generalSettingsService . ShowFilterHeader = ! IsOn ;
34
34
35
35
if ( IsOn )
36
36
{
37
+ // Delay to ensure the UI updates before focusing
38
+ await Task . Delay ( 100 ) ;
37
39
var filterTextBox = ( MainWindow . Instance . Content as Frame ) ? . FindDescendant ( "FilterTextBox" ) as AutoSuggestBox ;
38
40
filterTextBox ? . Focus ( FocusState . Programmatic ) ;
39
41
}
40
-
41
- return Task . CompletedTask ;
42
42
}
43
43
44
44
private void GeneralSettingsService_PropertyChanged ( object ? sender , PropertyChangedEventArgs e )
You can’t perform that action at this time.
0 commit comments