Inputtext: don't allow the cursor to move within a hint (#7507)

This commit is contained in:
hius07
2021-04-05 13:59:15 +03:00
committed by GitHub
parent d3f3e37f23
commit 17e6049e30

View File

@@ -120,6 +120,7 @@ if Device:isTouchDevice() or Device:hasDPad() then
if self.parent.onSwitchFocus then if self.parent.onSwitchFocus then
self.parent:onSwitchFocus(self) self.parent:onSwitchFocus(self)
end end
if #self.charlist == 0 then return end -- Avoid cursor moving within a hint.
local textwidget_offset = self.margin + self.bordersize + self.padding local textwidget_offset = self.margin + self.bordersize + self.padding
local x = ges.pos.x - self._frame_textwidget.dimen.x - textwidget_offset local x = ges.pos.x - self._frame_textwidget.dimen.x - textwidget_offset
local y = ges.pos.y - self._frame_textwidget.dimen.y - textwidget_offset local y = ges.pos.y - self._frame_textwidget.dimen.y - textwidget_offset