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

Table Keyboard Navigation with Header Row Hides First Data Row #5088

Open
2 tasks done
groboclown opened this issue Aug 24, 2024 · 0 comments · May be fixed by #5122
Open
2 tasks done

Table Keyboard Navigation with Header Row Hides First Data Row #5088

groboclown opened this issue Aug 24, 2024 · 0 comments · May be fixed by #5122
Labels
bug Something isn't working

Comments

@groboclown
Copy link

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

I created a Table widget and included a header row. I filled the row with enough data to allow the table to have a scroll bar.

When I use the keyboard to navigate up and down, before scrolling, the "current focus" cell moves correctly up to row 0. However, if you scroll with the keyboard such that the table scrolls down, then scroll back to the top, the "current focus" row will move what seems like under the header and will no longer be visible. It means the top row (row 0) will never be viewable in this table view without using the mouse.

How to reproduce

  1. Create a table with a header, and fill the cells with simple data.
  2. Click on a cell to allow keyboard navigation.
  3. Press the "up" key. The active cell correctly remains visible even when the up key is pressed with row zero active.
  4. Scroll down with the "down" key such that the displayed cells scroll.
  5. Press the "up" key to return to the top. The displayed active cell will disappear, and the top row does not show up, as though it's hidden under the table header.

Screenshots

TableKeyboardScroll

Example code

package main

import (
	"strconv"

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

func main() {
	a := app.New()
	w := a.NewWindow("Table Scroll")

	t := widget.NewTable(
		func() (rows int, cols int) { return 1000, 1 },
		func() fyne.CanvasObject { return widget.NewLabel("000") },
		func(tci widget.TableCellID, co fyne.CanvasObject) {
			co.(*widget.Label).SetText(strconv.FormatInt(int64(tci.Row), 10))
		},
	)
	t.ShowHeaderRow = true
	t.CreateHeader = func() fyne.CanvasObject { return widget.NewLabel("Row") }
	t.UpdateHeader = func(id widget.TableCellID, template fyne.CanvasObject) {}
	w.SetContent(container.NewStack(t))
	w.Resize(fyne.Size{Width: 100, Height: 250})

	w.ShowAndRun()
}

Fyne version

2.5.0

Go compiler version

1.22.6

Operating system and version

Arch Linux

Additional Information

No response

@groboclown groboclown added the unverified A bug that has been reported but not verified label Aug 24, 2024
@andydotxyz andydotxyz added bug Something isn't working and removed unverified A bug that has been reported but not verified labels Sep 4, 2024
@andydotxyz andydotxyz added this to the E fixes (v2.5.x) milestone Sep 4, 2024
pierrec pushed a commit to pierrec/fyne that referenced this issue Sep 8, 2024
@pierrec pierrec linked a pull request Sep 8, 2024 that will close this issue
3 tasks
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

Successfully merging a pull request may close this issue.

2 participants