[UX] Search dialogs: don't close when searching with nothing entered (#7501)

File search, Fulltext search, Search dictionary, Search Wikipedia, DictQuickLookup: do nothing when nothing entered and search is pressed.
This commit is contained in:
hius07
2021-04-04 18:27:17 +03:00
committed by GitHub
parent 10922561dd
commit aef1e271b5
5 changed files with 26 additions and 39 deletions

View File

@@ -693,6 +693,7 @@ function ReaderDictionary:onShowDictionaryLookup()
text = _("Search dictionary"),
is_enter_default = true,
callback = function()
if self.dictionary_lookup_dialog:getInputText() == "" then return end
UIManager:close(self.dictionary_lookup_dialog)
-- Trust that input text does not need any cleaning (allows querying for "-suffix")
self:onLookupWord(self.dictionary_lookup_dialog:getInputText(), true)