Skip to content

Select Does Not Gain Focus When Tapped #4767

Closed
@jimorc

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

The Select widget does not gain focus when tapped.

How to reproduce

  1. Build the example program.
  2. Run the program and set the focus to either the Entry or the Button.
  3. Click on the Select and select one of the items.
  4. Focus remains on whichever of the Entry or Button that had focus before.

Screenshots

No response

Example code

package main

import (
	"fmt"

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

func main() {
	myApp := app.New()
	mainWin := myApp.NewWindow("Select Test")
	entry := widget.NewEntry()
	sel := widget.NewSelect([]string{"Item 1", "Item 2", "Item 3"}, selectChanged)
	button := widget.NewButton("OK", tapped)
	box := container.New(layout.NewVBoxLayout(), entry, sel, button)
	mainWin.SetContent(box)
	mainWin.ShowAndRun()
}

func selectChanged(value string) {
	fmt.Printf("Selected value = %v\n", value)
}

func tapped() {
	fmt.Println("In tapped")
}

Fyne version

2.4.4

Go compiler version

1.22.1

Operating system and version

macOS 14.4.1

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

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions