Skip to content

Multiple forms can interfere with each other #278

Open
@seanamos

Description

Describe the bug
I noticed some odd behavior when using 2 (or more) separate forms in the same TUI.
They were jumping fields, as if they were being keypressed, however, tea.KeyMsg messages were not being sent to them.

This seems to be as a result of the nextGroupMsg, nextFieldMsg etc. messages not carrying an identifier with them (like the Spinner), so they will be received and processed by any huh.Form in the TUI. You can do things to prevent all messages from arriving at the forms when they are not "in focus", but this also comes with some additional plumbing to re-run Init functions.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinginput

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions