mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
InputText: fix 'number' hint (#9362)
When input_type == "number" convert the hint to "string" type. Closes #9359.
This commit is contained in:
@@ -350,9 +350,14 @@ function InputText:init()
|
||||
end
|
||||
-- Beware other cases where implicit conversion to text may be done
|
||||
-- at some point, but checkTextEditability() would say "not editable".
|
||||
if self.input_type == "number" and type(self.text) == "number" then
|
||||
-- checkTextEditability() fails if self.text stays not a string
|
||||
self.text = tostring(self.text)
|
||||
if self.input_type == "number" then
|
||||
if type(self.text) == "number" then
|
||||
-- checkTextEditability() fails if self.text stays not a string
|
||||
self.text = tostring(self.text)
|
||||
end
|
||||
if type(self.hint) == "number" then
|
||||
self.hint = tostring(self.hint)
|
||||
end
|
||||
end
|
||||
self:initTextBox(self.text)
|
||||
self:checkTextEditability()
|
||||
|
||||
Reference in New Issue
Block a user