fixed backspace moving cursor early bug
This commit is contained in:
@@ -5131,8 +5131,11 @@ function Element:keypressed(key, scancode, isrepeat)
|
|||||||
self:deleteSelection()
|
self:deleteSelection()
|
||||||
elseif self._cursorPosition > 0 then
|
elseif self._cursorPosition > 0 then
|
||||||
-- Delete character before cursor
|
-- Delete character before cursor
|
||||||
self:deleteText(self._cursorPosition - 1, self._cursorPosition)
|
-- Update cursor position BEFORE deleteText so updates use correct position
|
||||||
self._cursorPosition = self._cursorPosition - 1
|
local deleteStart = self._cursorPosition - 1
|
||||||
|
local deleteEnd = self._cursorPosition
|
||||||
|
self._cursorPosition = deleteStart
|
||||||
|
self:deleteText(deleteStart, deleteEnd)
|
||||||
self:_validateCursorPosition()
|
self:_validateCursorPosition()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user