Skip to content

Commit be1a3d3

Browse files
committed
Fix input issues
1 parent 0504496 commit be1a3d3

File tree

4 files changed

+23
-1155
lines changed

4 files changed

+23
-1155
lines changed

druid/extended/input.lua

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ function Input.on_input(self, action_id, action)
240240
if self.max_length then
241241
self.marked_value = utf8.sub(self.marked_value, 1, self.max_length)
242242
end
243-
is_marked_text_changed = true
243+
is_marked_text_changed = self.marked_value ~= ""
244244
end
245245

246246
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)
280280
end
281281

282282
if input_text or is_marked_text_changed then
283-
self:set_text(input_text)
283+
self:set_text(input_text or self.value)
284284

285285
if cursor_shift_indexes then
286286
self:select_cursor(self.cursor_index + cursor_shift_indexes)
@@ -304,11 +304,6 @@ function Input.on_focus_lost(self)
304304
end
305305

306306

307-
function Input.on_input_interrupt(self)
308-
--self:unselect()
309-
end
310-
311-
312307
function Input.get_text_selected(self)
313308
if self.start_index == self.end_index then
314309
return self.value

0 commit comments

Comments
 (0)