mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 05:45:49 +03:00
[GH-ISSUE #1025] InputField SetText append text instead of replacing it #744
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#744
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 @CarlosMontilla on GitHub (Sep 14, 2024).
Original GitHub issue: https://github.com/rivo/tview/issues/1025
Hello,
First of all I would like to thank you for this wonderful library.
Recently I updated to the latest release 20240818110301-fd649dbf1223 from the previous one 20230325211341-281d14d896d7.
And I've encountered a strange behaviour with the InputField.SetText method in the latest version. If I take the InputField demo and add 2 consecutive SetText("12"), the resulting input field text contains the string "1212". So the second SetText had the effect of appending the string instead to the current text field of replacing it. While in the previous version, I encountered the behaviour I would expect. The second SetText replaced the string.
I leave the code below and a screenshot of what I get
Latest version:

Previous version:

I will keep looking to see if I find the cause of this change of behaviour, but maybe you can spot the problem faster than me.
Thank you for your support
@rivo commented on GitHub (Sep 21, 2024):
Thanks. The latest commit should fix this.