Fix input issues

This commit is contained in:
Insality
2025-04-07 21:59:50 +03:00
parent 0504496975
commit be1a3d3788
4 changed files with 23 additions and 1155 deletions

View File

@@ -240,7 +240,7 @@ function Input.on_input(self, action_id, action)
if self.max_length then
self.marked_value = utf8.sub(self.marked_value, 1, self.max_length)
end
is_marked_text_changed = true
is_marked_text_changed = self.marked_value ~= ""
end
if action_id == const.ACTION_BACKSPACE and (action.pressed or action.repeated) then
@@ -280,7 +280,7 @@ function Input.on_input(self, action_id, action)
end
if input_text or is_marked_text_changed then
self:set_text(input_text)
self:set_text(input_text or self.value)
if cursor_shift_indexes then
self:select_cursor(self.cursor_index + cursor_shift_indexes)
@@ -304,11 +304,6 @@ function Input.on_focus_lost(self)
end
function Input.on_input_interrupt(self)
--self:unselect()
end
function Input.get_text_selected(self)
if self.start_index == self.end_index then
return self.value