Skip to content

widget.List in widget.AccordionItem not all are displayed #4126

Closed
@linauror

Description

Checklist

  • I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

widget.List in widget.AccordionItem, when AccordionItem open, only one item with scroll bar is displayed, not all are displayed

How to reproduce

1, go run code
2, clike item1

Screenshots

Now:
image

Want:
image

Example code

func main() {
	myApp := app.New()
	myWindow := myApp.NewWindow("all items will display")

	items := []string{"a", "b", "c"}
	item1 := widget.NewList(func() int {
		return len(items)
	}, func() fyne.CanvasObject {
		return widget.NewLabel("key")
	}, func(id widget.ListItemID, o fyne.CanvasObject) {
		o.(*widget.Label).SetText(items[id])
	})

	itemLayout := widget.NewAccordion(widget.NewAccordionItem("item1", item1))
	content := container.NewMax(itemLayout)

	myWindow.SetContent(content)
	myWindow.Resize(fyne.NewSize(300, 300))
	myWindow.ShowAndRun()
}

Fyne version

v2.3.5

Go compiler version

1.19.9

Operating system and version

Windows 10

Additional Information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions