Skip to content

Keep GridWrap highlight visible after scroll#6344

Open
puneetdixit200 wants to merge 1 commit into
fyne-io:developfrom
puneetdixit200:fix-gridwrap-highlight-scroll
Open

Keep GridWrap highlight visible after scroll#6344
puneetdixit200 wants to merge 1 commit into
fyne-io:developfrom
puneetdixit200:fix-gridwrap-highlight-scroll

Conversation

@puneetdixit200

Copy link
Copy Markdown

Description:

Fixes #5992

Keeps the GridWrap keyboard highlight clamped to the visible item range after scrolling. This lets subsequent arrow-key navigation continue from the current viewport instead of jumping back to a stale off-screen highlighted item.

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

Testing:

  • go test ./widget -run '^TestGridWrap_ScrollKeepsHighlightVisible$' -count=1\n- go test ./widget -run '^TestGridWrap' -count=1\n- go test ./widget -run '^Test(GridWrap|List|Tree)_(ScrollTo|TypedKey|Highlight)' -count=1\n- go vet ./widget\n- go run golang.org/x/tools/cmd/goimports@latest -e -d widget/gridwrap.go widget/gridwrap_test.go\n- go run mvdan.cc/gofumpt@latest -l widget/gridwrap.go widget/gridwrap_test.go\n- git diff --check\n\ngo test ./widget -count=1 hit unrelated local golden-render differences in List/Tree scrollbars/images on macOS; the focused GridWrap and nearby scroll/highlight tests above passed.

@andydotxyz

Copy link
Copy Markdown
Member

I don't agree with this change. Scrolling does not imply the user is not interested in the current selection. See List/Tree etc - the selected item does not change when they scroll.

Selecting an item, then scrolling, then tapping "down" should move to the item below the selected one, not to a new item based on where the viewport is scrolled to

@andydotxyz

Copy link
Copy Markdown
Member

Any other team members want to weigh in on this before I close?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gridWrap.ScrollToBottom() keeps highlight and jumps back to it

3 participants