mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
InputContainer: consistent input type in onInput() (#12012)
This commit is contained in:
@@ -362,10 +362,10 @@ end
|
||||
function InputContainer:onInput(input, ignore_first_hold_release)
|
||||
local InputDialog = require("ui/widget/inputdialog")
|
||||
self.input_dialog = InputDialog:new{
|
||||
title = input.title or "",
|
||||
title = input.title,
|
||||
input = input.input_func and input.input_func() or input.input,
|
||||
input_hint = input.hint_func and input.hint_func() or input.hint or "",
|
||||
input_type = input.type or "number",
|
||||
input_hint = input.hint_func and input.hint_func() or input.hint,
|
||||
input_type = input.input_type,
|
||||
buttons = input.buttons or {
|
||||
{
|
||||
{
|
||||
@@ -379,9 +379,10 @@ function InputContainer:onInput(input, ignore_first_hold_release)
|
||||
text = input.ok_text or _("OK"),
|
||||
is_enter_default = true,
|
||||
callback = function()
|
||||
if input.deny_blank_input and self.input_dialog:getInputText() == "" then return end
|
||||
input.callback(self.input_dialog:getInputText())
|
||||
self:closeInputDialog()
|
||||
if input.allow_blank_input or self.input_dialog:getInputText() ~= "" then
|
||||
input.callback(self.input_dialog:getInputText())
|
||||
self:closeInputDialog()
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user