mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 13:25:51 +03:00
[GH-ISSUE #1014] Issue with setTranform in textArea #733
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#733
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 @kirankn8 on GitHub (Aug 3, 2024).
Original GitHub issue: https://github.com/rivo/tview/issues/1014
@rivo I am trying to write a custom input handler which handles sensitive information, the setTranform function is not public due to which I am unable to utilize the functionality to mask sensitive information.
github.com/rivo/tview@65571ae51e/textarea.go (L1607C20-L1607C32)Could you please fix it
@rivo commented on GitHub (Aug 3, 2024):
That's what
InputFieldand itsSetMaskCharacter()function is for.@kirankn8 commented on GitHub (Aug 3, 2024):
yes @rivo , but when I try to write a custom inputField (because I have a custom design/logic) similar to the InputField, the textArea does not expose setTranform function. hence I cannot implement masking of password in my custom inputField
@rivo commented on GitHub (Aug 4, 2024):
I don't plan on making
setTransformpublic. It's a hack to make password masking work inInputFields. But it's not a functionality thatTextAreaneeds IMHO. In the grander scheme of things,TextAreamight benefit from a way to format text, e.g. for colour coding, line numbers, or auto-formatting. But that's a huge undertaking andsetTransformwill not fit the bill, it will likely be removed at that point (which I can't if it's public). I haven't even begun to think about this.I don't know what your "custom design/logic" is but I would suggest you build on top of
InputFieldinstead ofTextArea. If you want to describe your customizations, I might be able to give you some pointers.@kirankn8 commented on GitHub (Aug 4, 2024):
ok, understood. one of my requirement is I want to change the appearance of the input field from the box look (as seen in your examples https://github.com/rivo/tview/wiki/InputField) to something like this
Enter a number : [ ].How could I approach this
@kirankn8 commented on GitHub (Aug 4, 2024):
Nvm, I think I figured it out how to go about this. thank you for your quick response. I am closing this ticket.