How can i do? (press enter focus next input widget) #3943
burhansvural
started this conversation in
General
Replies: 2 comments 12 replies
-
You could focus the next widget when from textual import on
from textual.app import App, ComposeResult
from textual.widgets import Input
class FocusNextOnSubmutApp(App[None]):
def compose(self) -> ComposeResult:
for n in range(10):
yield Input(placeholder=f"This is input {n}")
@on(Input.Submitted)
def go_next(self) -> None:
self.screen.focus_next()
if __name__ == "__main__":
FocusNextOnSubmutApp().run() |
Beta Was this translation helpful? Give feedback.
12 replies
-
I am working now. Thank you very much, Tom.
TomJGooding ***@***.***>, 2 Oca 2024 Sal, 20:25 tarihinde
şunu yazdı:
… @burhansvural <https://github.com/burhansvural> I would recommend working
through the Textual tutorial <https://textual.textualize.io/tutorial/> if
you haven't done so already. The tutorial provides a great introduction to
important concepts such as custom widgets. reactive attributes and messages
that it looks like you'll need for your application.
Textual's documentation really is excellent, so after finishing the
tutorial I would encourage also checking out the Guide
<https://textual.textualize.io/guide/> for an in-depth reference.
Of course if there's something you need help with or just unsure about, as
you've found the Textual community is happy to help!
—
Reply to this email directly, view it on GitHub
<#3943 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BDXQYGWNWOOVEVQ5WBA5BP3YMQ7IDAVCNFSM6AAAAABBJ3HPVSVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TSOJVGQ2DS>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have 8 input widgets on the screen. I want to focus the next input widget when I press the enter key instead of the tab key. How can I do this?
Beta Was this translation helpful? Give feedback.
All reactions