Skip to content

Commit

Permalink
Fix EditField eating Hotkey
Browse files Browse the repository at this point in the history
  • Loading branch information
wiktor-obrebski committed Jan 20, 2025
1 parent b1e2185 commit 93845d1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions library/lua/gui/widgets/edit_field.lua
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,17 @@ function EditField:insert(text)
end

function EditField:onInput(keys)
if self.text_area.focus and self.key and
(keys.LEAVESCREEN or keys._MOUSE_R) then
if not self.text_area.focus then
return self:inputToSubviews(keys)
end

if self.key and (keys.LEAVESCREEN or keys._MOUSE_R) then
self:setText(self.saved_text)
self:setFocus(false)
return true
end

if EditField.super.onInput(self, keys) then
if self.text_area:onInput(keys) then
return true
end

Expand Down

0 comments on commit 93845d1

Please sign in to comment.