mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #1001] InputField placeholder text is word-wrapped #725
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#725
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 @kivattt on GitHub (Jun 24, 2024).
Original GitHub issue: https://github.com/rivo/tview/issues/1001
In my project using tview, I have an InputField with SetFieldWidth(45), with some placeholder text.
I noticed when the second word in the placeholder was long enough, it would suddenly disappear and show only the first word!
This code demonstrates the issue:
InputField uses a TextArea to draw the placeholder
github.com/rivo/tview@c38c796625/inputfield.go (L475)Which uses a TextView with word-wrapping enabled by default
github.com/rivo/tview@c38c796625/textarea.go (L1325-L1326)If this is intended behaviour, it would be nice to have something like
.SetWrap()or.SetWordWrap()as part of InputField@rivo commented on GitHub (Jun 26, 2024):
So you would like to see partial words in the placeholder text? I wonder what the rationale is for that. Consider this example:
I'm not sure that this would be good for the user.
Maybe you can explain why you'd want this?
@kivattt commented on GitHub (Jun 29, 2024):
I agree that makes sense for most cases where you show normal text as words. I should have clarified that I am using an input field with a command as the placeholder where I do not want word-wrapping because it can hide arguments from the user

Notice the aqua colored text below the input field shows the start of a command argument, which isn't hinted at in the inputfield placeholder