mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 13:55:51 +03:00
[PR #208] [CLOSED] change: provide drop-down option text and index as args to selection callback when using (*DropDown).AddOption() #878
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#878
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?
📋 Pull Request Information
Original PR: https://github.com/rivo/tview/pull/208
Author: @ardnew
Created: 12/18/2018
Status: ❌ Closed
Base:
master← Head:dropdown-addoption📝 Commits (7)
334dfbeAdding accept() callback support for all relevant input changes in an InputField739b305Merge https://github.com/rivo/tviewa207e47change: provide drop-down option text and index as args to selection callback when using (*DropDown).AddOption()4dafc38change: provide drop-down option text and index as args to selection callback when using (*DropDown).AddOption()75c14a5Merge remote-tracking branch 'upstream/master'80eeae3Merge branch 'dropdown-addoption' of https://github.com/ardnew/tviewfafd074change: implemented view tracking in List for more natural navigation📊 Changes
3 files changed (+62 additions, -31 deletions)
View changed files
📝
dropdown.go(+17 -13)📝
inputfield.go(+4 -2)📝
list.go(+41 -16)📄 Description
rivo/tview#206
this change will break backwards compatibility for anyone using
(*DropDown).AddOption()as its formal signature is changed. but i'm not convinced it's worth preserving the original and implementing this under a different name as the functionality is basically identical.also I wasn't sure why
(*DropDown).SetOptions()had the anon function in the body of its for-loop, so I took the liberty of removing it because it was a little confusing that variable identifiers were being reused at different scopes.but even if you want to restore it, one of the variables (
textI believe) was being captured under the closure even though it was passed in via argument! so that needs to be changed regardless.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.