Using the latest version (github.com/rivo/tview v0.0.0-20231031172508-2dfe06011790) I have found an inconsistent behavior for InputField. I believe it was introduced at commit 6416d6b.
When calling .SetText on an InputField, the changed function gets called three times.
As you can see the function given to SetChangedFunc was called 3 times with the same string, even though the input just changed once (call to .SetText). I expected it to be called only once.
Thank you for letting me know about this. Yes, there were indeed a few too many calls to the "changed" callback in the code. The latest commit should fix this.
Hi :wave:, thanks for this great library.
Using the latest version (
github.com/rivo/tview v0.0.0-20231031172508-2dfe06011790
) I have found an inconsistent behavior for InputField. I believe it was introduced at commit 6416d6b.When calling
.SetText
on an InputField, thechanged
function gets called three times.Here is a repo that reproduces the issue: https://github.com/vitorqb/tview-bug
Here is the base snippet:
Which prints
As you can see the function given to
SetChangedFunc
was called 3 times with the same string, even though the input just changed once (call to.SetText
). I expected it to be called only once.