[GH-ISSUE #36] Feature Request: longer text input in forms #28

Closed
opened 2026-03-04 01:01:15 +03:00 by kerem · 1 comment
Owner

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?

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?
kerem closed this issue 2026-03-04 01:01:15 +03:00
Author
Owner

@rivo commented on GitHub (Jan 19, 2018):

Hi, glad you like it. There are two issues here: The first one is that currently, the Form class is built only for one-line form elements. You do have an InputField but 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 Flex to 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 tview currently has no multi-line input field. There is the TextView but 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 tview widget. But having just spent quite a bit of time just making TextView work for all the different edge cases, I'm sure it will take some time.

<!-- gh-comment-id:358889775 --> @rivo commented on GitHub (Jan 19, 2018): Hi, glad you like it. There are two issues here: The first one is that currently, the `Form` class is built only for one-line form elements. You do have an `InputField` but 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 `Flex` to 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 `tview` currently has no multi-line input field. There is the `TextView` but 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 `tview` widget. But having just spent quite a bit of time just making `TextView` work for all the different edge cases, I'm sure it will take some time.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#28
No description provided.