Skip to content

Commit

Permalink
fix: clear search columns when genre search mode changes
Browse files Browse the repository at this point in the history
fix: make sure _something_ other than the search field gets focused on Enter
  • Loading branch information
xxxserxxx committed Oct 28, 2024
1 parent cfef241 commit 5cac4ac
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions page_search.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ func (ui *Ui) createSearchPage() *SearchPage {
searchPage.ui.app.SetFocus(searchPage.searchField)
return nil
case 'g':
searchPage.albumList.Clear()
searchPage.artistList.Clear()
searchPage.songList.Clear()
if searchPage.queryGenre {
searchPage.albumList.SetTitle(" album matches ")
} else {
Expand Down Expand Up @@ -179,6 +182,9 @@ func (ui *Ui) createSearchPage() *SearchPage {
searchPage.ui.app.SetFocus(searchPage.searchField)
return nil
case 'g':
searchPage.albumList.Clear()
searchPage.artistList.Clear()
searchPage.songList.Clear()
if searchPage.queryGenre {
searchPage.albumList.SetTitle(" album matches ")
} else {
Expand Down Expand Up @@ -223,6 +229,9 @@ func (ui *Ui) createSearchPage() *SearchPage {
searchPage.ui.app.SetFocus(searchPage.searchField)
return nil
case 'g':
searchPage.albumList.Clear()
searchPage.artistList.Clear()
searchPage.songList.Clear()
if searchPage.queryGenre {
searchPage.albumList.SetTitle(" album matches ")
} else {
Expand Down Expand Up @@ -253,6 +262,7 @@ func (ui *Ui) createSearchPage() *SearchPage {

queryStr := searchPage.searchField.GetText()
search <- queryStr
searchPage.aproposFocus()
default:
return event
}
Expand Down

0 comments on commit 5cac4ac

Please sign in to comment.