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

SelectEntry cause UI hang #2925

Closed
shvc opened this issue Apr 16, 2022 · 3 comments
Closed

SelectEntry cause UI hang #2925

shvc opened this issue Apr 16, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@shvc
Copy link

shvc commented Apr 16, 2022

Describe the bug:

Click SeletEntry's dropdown icon cause UI hang.
Manual input or not input(not click dropdown icon) is fine.

To Reproduce:

Steps to reproduce the behaviour:

  1. Select a Value from SelectEntry or just Clict SeletEntry's dropdown icon
  2. Click on 'Enter'
  3. Click on 'Back'
  4. UI hang

Example code:

package main

import (
	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/container"
	"fyne.io/fyne/v2/theme"
	"fyne.io/fyne/v2/widget"
)

func main() {
	a := app.NewWithID("cc.select")
	w := a.NewWindow("SelectEntry")
	user := widget.NewSelectEntry([]string{"a1", "a2", "a3"})
	var enter, body *fyne.Container
	enter = container.NewVBox(user,
		widget.NewButton("Enter", func() {
			w.SetContent(body)
			w.Resize(fyne.NewSize(200, 100))
			w.Show()
		}),
	)
	top := container.NewHBox(
		widget.NewButtonWithIcon("Back", theme.NavigateBackIcon(), func() {
			w.SetContent(enter)
			w.Resize(fyne.NewSize(300, 180))
			w.Show()
		}),
	)
	body = container.NewBorder(top, nil, nil, nil, top)
	w.SetContent(enter)
	w.Resize(fyne.NewSize(300, 180))
	w.ShowAndRun()
}

Device (please complete the following information):

  • OS: Linux, MacOS
  • Version: MacOS11.6.5, and Ubuntu20.04.3 LTS (Focal Fossa)
  • Go version: 1.17, 1.18
  • Fyne version: v2.1.4
@shvc shvc added the unverified A bug that has been reported but not verified label Apr 16, 2022
@andydotxyz
Copy link
Member

The top is being passed to Border container twice which does not seem right.
I don’t know if that relates to the problem.
Also not sure why you have window.Show calls - the window must be visible if the button was pressed :)

@shvc
Copy link
Author

shvc commented Apr 17, 2022

window.Show and Border container removed
the Back Buttion still hang if click SeletEntry's dropdown icon

package main

import (
	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/container"
	"fyne.io/fyne/v2/theme"
	"fyne.io/fyne/v2/widget"
)

func main() {
	a := app.NewWithID("cc.select")
	w := a.NewWindow("SelectEntry")
	user := widget.NewSelectEntry([]string{"a1", "a2", "a3"})
	passwd := widget.NewPasswordEntry()
	var body, enter *fyne.Container
	body = container.NewVBox(
		widget.NewButtonWithIcon("Back", theme.NavigateBackIcon(), func() {
			w.SetContent(enter)
			w.Resize(fyne.NewSize(300, 180))
		}),
	)
	enter = container.NewVBox(user, passwd,
		widget.NewButton("Enter", func() {
			w.SetContent(body)
			w.Resize(fyne.NewSize(200, 100))
		}),
	)
	w.SetContent(enter)
	w.Resize(fyne.NewSize(300, 180))
	w.ShowAndRun()
}

@andydotxyz andydotxyz added bug Something isn't working and removed unverified A bug that has been reported but not verified labels Apr 18, 2022
andydotxyz added a commit to andydotxyz/fyne that referenced this issue Apr 18, 2022
We have to be able to ask Canvas for its size etc.

Fixes fyne-io#2925
andydotxyz added a commit that referenced this issue Apr 18, 2022
We have to be able to ask Canvas for its size etc.

Fixes #2925
@andydotxyz
Copy link
Member

This is now fixed on develop branch ready for next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants