mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #36] Feature Request: longer text input in forms #28
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#28
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 @tanema on GitHub (Jan 18, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/36
Hey this is a great library, really great to use! I was hoping to either get you to implement a text area like input for forms or give me tips on how to do it myself. I tried implementing my own FormItem using a textview and input capture but can't get the hang of it.
Any tips or would this be something you could do easily?
@rivo commented on GitHub (Jan 19, 2018):
Hi, glad you like it. There are two issues here: The first one is that currently, the
Formclass is built only for one-line form elements. You do have anInputFieldbut I'm guessing you want a multi-line text area. This would complicate things quite a bit, especially with the horizontal layout option which i just introduced (see #33).I'm not sure if I will add that but I guess you could still use
Flexto attach such a text area to a form. It would not be directly part of the form itself but depending on your use case, it may be ok.The second issue is that
tviewcurrently has no multi-line input field. There is theTextViewbut you can't enter text. It's something that I may add in the long run but because it's not trivial, it's not there yet. (The package is only two weeks old at this point.) It also opens up the whole topic of implementing a complete text editor. Wide unicode characters, line/word breaks, and navigation are difficult to implement. I'm sure I will tackle this at some point but I don't know yet when.You can certainly try to implement this yourself and I could give you pointers as to how to implement your own
tviewwidget. But having just spent quite a bit of time just makingTextViewwork for all the different edge cases, I'm sure it will take some time.