diff --git a/components/search/SearchResults.brs b/components/search/SearchResults.brs index 42683e26..0eddf058 100644 --- a/components/search/SearchResults.brs +++ b/components/search/SearchResults.brs @@ -41,6 +41,13 @@ sub loadResults() m.searchSelect.itemdata = m.searchTask.results m.searchSelect.query = m.top.SearchAlpha m.searchHelpText.visible = false + if m.searchTask.results.TotalRecordCount = 0 + ' make sure focus is on the keyboard + if m.searchSelect.isinFocusChain() + m.searchAlphabox.setFocus(true) + end if + return + end if m.searchAlphabox = m.top.findnode("searchResults") m.searchAlphabox.translation = "[470, 85]" end sub @@ -63,8 +70,14 @@ function onKeyEvent(key as string, press as boolean) as boolean else if key = "play" and m.searchSelect.isinFocusChain() and m.searchSelect.rowItemFocused.count() > 0 print "play was pressed from search results" if m.searchSelect.rowItemFocused <> invalid - m.top.quickPlayNode = m.searchSelect.content.getChild(m.searchSelect.rowItemFocused[0]).getChild(m.searchSelect.rowItemFocused[1]) - return true + selectedContent = m.searchSelect.content.getChild(m.searchSelect.rowItemFocused[0]) + if selectedContent <> invalid + selectedItem = selectedContent.getChild(m.searchSelect.rowItemFocused[1]) + if selectedItem <> invalid + m.top.quickPlayNode = selectedItem + return true + end if + end if end if end if return false