Replies: 1 comment
-
What you could alternatively do is to call the import flet as ft
def main(page: ft.Page):
submit_button = ft.ElevatedButton(
"Submit", on_click=lambda _: print("Submitting ...")
)
def handle_submit(e):
submit_button.on_click(None)
page.add(
ft.TextField(
on_submit=handle_submit,
),
submit_button,
)
ft.app(main) |
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
-
Hey guys,
thanks a lt for your work on Flet!
Using Flet now more and more I realized I'm missing the
on_submit
feature on buttons a lot. For aTextField
it works fine but I would love to have the same feature to press a button when I press the Return key as well.What do you think?
Beta Was this translation helpful? Give feedback.
All reactions