From bff1e8deb7163da7f6561bf2dd5956dfb144442b Mon Sep 17 00:00:00 2001 From: hius07 <62179190+hius07@users.noreply.github.com> Date: Tue, 26 Jul 2022 13:04:40 +0300 Subject: [PATCH] InputText: fix 'number' hint (#9362) When input_type == "number" convert the hint to "string" type. Closes #9359. --- frontend/ui/widget/inputtext.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend/ui/widget/inputtext.lua b/frontend/ui/widget/inputtext.lua index 33fff6849..0093f494d 100644 --- a/frontend/ui/widget/inputtext.lua +++ b/frontend/ui/widget/inputtext.lua @@ -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()