mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #75] Support for InputFields hints/placeholders #55
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#55
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 @muesli on GitHub (Mar 13, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/75
It would be nice if InputFields supported hints (also known as placeholders sometimes).
@rivo commented on GitHub (Mar 13, 2018):
Similarly to my question in #77, is this an actual requirement you came across in your application? All input fields have labels. Maybe you can provide an example where they aren't enough?
@muesli commented on GitHub (Mar 13, 2018):
It would be nice to give user some form of indication what a reasonable / expected value would look like, without having to pre-set it as an InputField's value. One could add this information to the label, but in case of longer hints, this quickly breaks the layout and looks a bit messy from a UX perspective.
@rivo commented on GitHub (Mar 15, 2018):
Have a look at the latest commit. This adds
SetPlaceholder()toInputField.@muesli commented on GitHub (Mar 18, 2018):
Works nicely, the only minor nitpick I have is that it's barely readable with the default color scheme.
@rivo commented on GitHub (Mar 18, 2018):
It looks good in my terminal. The idea is to give it low contrast (just like HTML placeholders are usually also low-contrast) so it's not confused with actual input. But you're free to set
Styles.ContrastSecondaryTextColorto your own choice of color.