From 17e6049e3004bafbf7897240ba123e1408516222 Mon Sep 17 00:00:00 2001 From: hius07 <62179190+hius07@users.noreply.github.com> Date: Mon, 5 Apr 2021 13:59:15 +0300 Subject: [PATCH] Inputtext: don't allow the cursor to move within a hint (#7507) --- frontend/ui/widget/inputtext.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/ui/widget/inputtext.lua b/frontend/ui/widget/inputtext.lua index c2d46ea38..d0e564011 100644 --- a/frontend/ui/widget/inputtext.lua +++ b/frontend/ui/widget/inputtext.lua @@ -120,6 +120,7 @@ if Device:isTouchDevice() or Device:hasDPad() then if self.parent.onSwitchFocus then self.parent:onSwitchFocus(self) end + if #self.charlist == 0 then return end -- Avoid cursor moving within a hint. local textwidget_offset = self.margin + self.bordersize + self.padding local x = ges.pos.x - self._frame_textwidget.dimen.x - textwidget_offset local y = ges.pos.y - self._frame_textwidget.dimen.y - textwidget_offset