Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to render stateful widget inside popup #10

Open
kxxt opened this issue Apr 29, 2024 · 4 comments
Open

Possibility to render stateful widget inside popup #10

kxxt opened this issue Apr 29, 2024 · 4 comments

Comments

@kxxt
Copy link
Contributor

kxxt commented Apr 29, 2024

I want to render a stateful widget(The built-in widget list). But it appears that I can't pass the state through tui-popup.

Would it be possible to design an API to allow state to be passed through tui-popup to a inner stateful widget? Or should we change the API to make popup work more like a Block so that users could manually render whatever they want inside it?

@joshka
Copy link
Owner

joshka commented May 1, 2024

I'm open to the idea. Do you any ideas about what the the API would look like if you implemented this?

@kxxt
Copy link
Contributor Author

kxxt commented May 1, 2024

I'm open to the idea. Do you any ideas about what the the API would look like if you implemented this?

I think the most obvious way is to create another type StatefulPopup but that will introduce lots of duplicated code which is not ideal (though we could avoid probably most of the duplication by using macros).

@joshka
Copy link
Owner

joshka commented May 7, 2024

A similar gap was mentioned in https://discord.com/channels/1070692720437383208/1072907135664529508/1237425024969871420

I think the most obvious way is to create another type StatefulPopup but that will introduce lots of duplicated code which is not ideal (though we could avoid probably most of the duplication by using macros).

I have a preference for this to be a single widget rather than two if it makes sense. The trait implementations are after all just traits Perhaps this is not possible however.

@joshka
Copy link
Owner

joshka commented Jul 25, 2024

Moving this issue to tui-widgets repo

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

No branches or pull requests

2 participants