mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[fix] InputText: fix ignoring first char when carat not in front of hint (#5052)
This commit is contained in:
committed by
Frans de Jonge
parent
1657c5e412
commit
98b681bb4f
@@ -434,7 +434,11 @@ function InputText:addChars(chars)
|
||||
if self.readonly or not self:isTextEditable(true) then
|
||||
return
|
||||
end
|
||||
|
||||
self.is_text_edited = true
|
||||
if #self.charlist == 0 then -- widget text is empty or a hint text is displayed
|
||||
self.charpos = 1 -- move cursor to the first position
|
||||
end
|
||||
table.insert(self.charlist, self.charpos, chars)
|
||||
self.charpos = self.charpos + #util.splitToChars(chars)
|
||||
self:initTextBox(table.concat(self.charlist), true)
|
||||
|
||||
Reference in New Issue
Block a user