mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 05:45:49 +03:00
[GH-ISSUE #631] feature request: expose modal form #461
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#461
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SamWhited on GitHub (Aug 3, 2021).
Original GitHub issue: https://github.com/rivo/tview/issues/631
Hi, when using modals I frequently want to provide information, eg. a modal with a
TextInputViewas well as a button for accepting it. Since modals already use a form internally, this requires very few changes (the height must be changed to accommodate the form and the form itself must be exposed in some way, eg. by exporting it or by providing a(m *Modal) Form() *Form)method or similar). Please consider making the form accessible so that other items can be added to it besides buttons. Thanks.I am happy to submit a PR to implement this change if you are amenable to it.
@rivo commented on GitHub (Sep 27, 2021):
Have you checked out https://github.com/rivo/tview/wiki/Modal already? It's not that difficult to make a
Modalwith different elements.I guess the
Modalclass should have been namedPromptor something. It wasn't only meant for the simple windows that you typically encounter in an application which inform you of something or require some kind of confirmation.@SamWhited commented on GitHub (Sep 27, 2021):
That's what I'm doing right now, more or less. I think I ended up using a flex (I had originally copied modal, but decided to reimplement instead), but the modal modifications were simplee and required a lot less work on my end to mimic its behavior. That said, after the form is exposed modals have a lot of duplicate functionality, so maybe it's a bad idea. It remains unclear to me what things count as primitives and should be in the library vs. what I should do myself.
Thanks!