@@ -9,8 +9,8 @@ use crate::{
99 state:: {
1010 ActionListItem , Album , AlbumId , Artist , ArtistFocusState , ArtistId , ArtistPopupAction ,
1111 BrowsePageUIState , Context , ContextId , ContextPageType , ContextPageUIState , DataReadGuard ,
12- Focusable , Id , Item , ItemId , LibraryFocusState , LibraryPageUIState , PageState , PageType ,
13- PlayableId , Playback , PlaylistCreateCurrentField , PlaylistFolderItem , PlaylistId ,
12+ Focusable , Id , InputMode , Item , ItemId , LibraryFocusState , LibraryPageUIState , PageState ,
13+ PageType , PlayableId , Playback , PlaylistCreateCurrentField , PlaylistFolderItem , PlaylistId ,
1414 PlaylistPopupAction , PopupState , SearchFocusState , SearchPageUIState , SharedState , ShowId ,
1515 Track , TrackId , TrackOrder , UIStateGuard , USER_LIKED_TRACKS_ID ,
1616 USER_RECENTLY_PLAYED_TRACKS_ID , USER_TOP_TRACKS_ID ,
@@ -705,6 +705,11 @@ fn handle_global_command(
705705 line_input : LineInput :: default ( ) ,
706706 current_query : String :: new ( ) ,
707707 state : SearchPageUIState :: new ( ) ,
708+ mode : if config:: get_config ( ) . app_config . modal_search {
709+ Some ( InputMode :: default ( ) )
710+ } else {
711+ None
712+ } ,
708713 } ) ;
709714 }
710715 Command :: BrowsePage => {
@@ -855,6 +860,18 @@ fn handle_global_command(
855860 }
856861 }
857862 Command :: ClosePopup => {
863+ if let Some ( PopupState :: Search { ref mut mode, .. } ) = ui. popup {
864+ if let Some ( InputMode :: Insert ) = mode {
865+ * mode = Some ( InputMode :: Normal ) ;
866+ return Ok ( true ) ;
867+ }
868+ } else if config:: get_config ( ) . app_config . modal_search
869+ && ui. popup . is_none ( )
870+ && ui. history . len ( ) > 1
871+ {
872+ ui. history . pop ( ) ;
873+ }
874+
858875 ui. popup = None ;
859876 }
860877 _ => return Ok ( false ) ,
0 commit comments