2
0
mirror of https://github.com/koreader/koreader synced 2024-11-10 01:10:34 +00:00

InputText: Unbreak onTapTextBox on an already in-focus field (#12449)

The drive-by fix for the original issue noticed late in #12361 turned out to be a bit heavy-handed ;).

Fix #12444
Regression since #12361
This commit is contained in:
NiLuJe 2024-09-02 23:38:57 +02:00 committed by GitHub
parent 824bb98407
commit ae5222b97a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -142,8 +142,11 @@ local function initTouchEvents()
if self.keyboard then
self.keyboard:showKeyboard()
end
-- Make sure we're flagged as in focus again
self:focus()
-- Make sure we're flagged as in focus again.
-- NOTE: self:focus() does a full free/reinit cycle, which is completely unnecessary to begin with,
-- *and* resets cursor position, which is problematic when tapping on an already in-focus field (#12444).
-- So, just flip our own focused flag, that's the only thing we need ;).
self.focused = true
end
if self._frame_textwidget.dimen ~= nil -- zh keyboard with candidates shown here has _frame_textwidget.dimen = nil
and #self.charlist > 0 then -- do not move cursor within a hint