mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #898] List.RemoveItem() #652
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#652
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 @daniel-p-h on GitHub (Oct 6, 2023).
Original GitHub issue: https://github.com/rivo/tview/issues/898
Hi, I've just started toying with go so this might be my bad code, or a side effect of language features I don't understand.
When trying to put together a dynamic list the behaviour I'm experiencing is very unusal. I'm not entirely sure what it's doing to be honest, but it's not what I expected which is for items to be removed / added as per the result of strings.Contains(item, searchQuery).
Example code:
@daniel-p-h commented on GitHub (Oct 7, 2023):
Closed, my bad code! Logic for moving items back into the list is to blame
@rivo commented on GitHub (Oct 7, 2023):
Ok. You may also want to think about using
SetChangedFunc()instead ofSetInputCapture().SetInputCapture()is meant to intercept actual key stroke events whileSetChangedFunc()handles all common key strokes for you and then simply informs you that the content of theInputFieldhas changed.@daniel-p-h commented on GitHub (Oct 7, 2023):
I did notice this after I posted and it works much better, but thanks for taking the time to read!