Skip to content

Fix: Multiline Entry ignores scroll position on mobile TouchDown (#6307)#6417

Merged
andydotxyz merged 2 commits into
fyne-io:developfrom
AmeeteSh-A:fix-mobile-entry-scroll
Jul 16, 2026
Merged

Fix: Multiline Entry ignores scroll position on mobile TouchDown (#6307)#6417
andydotxyz merged 2 commits into
fyne-io:developfrom
AmeeteSh-A:fix-mobile-entry-scroll

Conversation

@AmeeteSh-A

Copy link
Copy Markdown
Contributor

Description:

TouchDown in widget/entry.go was directly reading ev.Position without accounting for the internal scroll offset. This caused the cursor to jump to the wrong line on mobile devices when a multiline entry was scrolled.

This patch mirrors the existing desktop MouseDown logic by adding e.scroll.Offset to the tap coordinates, ensuring the cursor lands exactly where the user taps.

Additionally, I added TestEntry_TouchDown_AccountsForScroll in a new internal widget/entry_touch_test.go file to prevent future regressions.

Fixes #6307

Checklist:

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

andydotxyz
andydotxyz previously approved these changes Jul 16, 2026

@andydotxyz andydotxyz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent catch, thanks so much for the clean fix

Fixing the whitespace
@andydotxyz

Copy link
Copy Markdown
Member

Just applying a whitespace fix to try and get this passing CI

@coveralls

coveralls commented Jul 16, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 59.833% (-0.007%) from 59.84% — AmeeteSh-A:fix-mobile-entry-scroll into fyne-io:develop

@andydotxyz
andydotxyz merged commit b4124b2 into fyne-io:develop Jul 16, 2026
13 checks passed
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.

Scrolling then clicking on a multiline Entry will ignore the scroll position and change it

3 participants