InputText: fix 'number' hint (#9362)

When input_type == "number" convert the hint to "string" type.
Closes #9359.
reviewable/pr9382/r1
hius07 2 years ago committed by GitHub
parent bbc5652c1d
commit bff1e8deb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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()

Loading…
Cancel
Save