Skip to content

Commit

Permalink
Add textinput event handlers.
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 committed Aug 7, 2023
1 parent 2ccd4f5 commit 4145764
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions textual/src/toga_textual/widgets/textinput.py
Expand Up @@ -9,6 +9,15 @@ def __init__(self, impl):
self.interface = impl.interface
self.impl = impl

def on_focus(self, event: TextualInput.Changed) -> None:
self.interface.on_gain_focus(None)

def on_input_changed(self, event: TextualInput.Changed) -> None:
self.interface.on_change(None)

def on_input_submitted(self, event: TextualInput.Submitted) -> None:
self.interface.on_submit(None)


class TextInput(Widget):
def create(self):
Expand Down

0 comments on commit 4145764

Please sign in to comment.