Skip to content

Form dialog with pre-filled text Entry widgets doesn't resize to allow for that text #5501

@pneumaticdeath

Description

@pneumaticdeath

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

When presenting a form witj text Entry widget(s) with even moderate amounts of text, the form presents fields that are much to small to be usable for anything other than a word or two.

How to reproduce

See attached code

  1. Push "Go" button
  2. Form unusably small

Screenshots

Image

Example code

package main

import (
	"fmt"

	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/container"
	"fyne.io/fyne/v2/dialog"
	"fyne.io/fyne/v2/widget"
)

func main() {
	a := app.New()
	w := a.NewWindow("Adaptive Layout")

	button := widget.NewButton("Go", func() {
		entry1 := widget.NewEntry()
		entry1.Text = "This is a little long"
		entry2 := widget.NewEntry()
		entry2.Text = "This is really very quite long, isn't it?"
		items := []*widget.FormItem{
			widget.NewFormItem("Foo", entry1),
			widget.NewFormItem("Bar", entry2)}
		dialog.ShowForm("Sample form", "Yes", "No", items, func(submitted bool) {
			if submitted {
				fmt.Println("Submitted")
			}
		}, w)
	})

	cont := container.NewCenter(button)

	w.SetContent(cont)
	w.Resize(fyne.NewSize(800,600))
	w.ShowAndRun()
}

Fyne version

2.5.3

Go compiler version

go1.23.4

Operating system and version

darwin/arm64 (Sequoia)

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    unverifiedA bug that has been reported but not verified

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions