Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make DefaultDelegate satisfy ItemDelegate interface #541

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

bashbunni
Copy link
Member

@bashbunni bashbunni commented Jun 21, 2024

No description provided.

@bashbunni bashbunni changed the base branch from master to beta June 21, 2024 17:08
@bashbunni bashbunni requested a review from muesli as a code owner June 21, 2024 17:08
@bashbunni bashbunni assigned bashbunni and aymanbagabas and unassigned bashbunni Jun 21, 2024
@@ -127,7 +127,7 @@ func (d DefaultDelegate) Spacing() int {
}

// Update checks whether the delegate's UpdateFunc is set and calls it.
func (d DefaultDelegate) Update(msg tea.Msg, m *Model) tea.Cmd {
func (d DefaultDelegate) Update(ctx tea.Context, msg tea.Msg, m *Model) tea.Cmd {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this not need to return the model?

Copy link
Member Author

@bashbunni bashbunni Jun 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems the ItemDelegate interface has a signature Update(ctx tea.Context, msg tea.Msg, m *Model) tea.Cmd... So not sure if the ItemDelegate should be the same Update sig as a bubble tea model

https://github.com/charmbracelet/bubbles/blob/beta/list/list.go#L51

@bashbunni bashbunni changed the title fixL make DefaultDelegate satisfy ItemDelegate interface fix: make DefaultDelegate satisfy ItemDelegate interface Jun 24, 2024
@bashbunni
Copy link
Member Author

Hey @aymanbagabas do you mind taking a look at this when you have a moment?

@bashbunni bashbunni merged commit bd3a206 into beta Jul 8, 2024
2 of 18 checks passed
@bashbunni bashbunni deleted the beta-examples branch July 8, 2024 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants