Skip to content

fix(textbox): keep TextBox from being scrolled away when focused with a touch pointer - #20155

Merged
jeromelaban merged 8 commits into
unoplatform:masterfrom
ramezgerges:keep_touch_textbox_into_view
May 13, 2025
Merged

jeromelaban merged 8 commits into
unoplatform:masterfrom
ramezgerges:keep_touch_textbox_into_view

Conversation

@ramezgerges

Copy link
Copy Markdown
Contributor

GitHub Issue (If applicable): closes https://github.com/unoplatform/uno-private/issues/1164

PR Type

What kind of change does this PR introduce?

What is the current behavior?

What is the new behavior?

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@ramezgerges
ramezgerges marked this pull request as draft May 6, 2025 19:35
@github-actions github-actions Bot added the area/skia ✏️ Categorizes an issue or PR as relevant to Skia label May 8, 2025
@ramezgerges
ramezgerges marked this pull request as ready for review May 8, 2025 04:46
@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@ramezgerges
ramezgerges force-pushed the keep_touch_textbox_into_view branch from 92e432d to dd89bc9 Compare May 8, 2025 16:27
@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 164974 has failed on Uno.UI - CI.

@jeromelaban
jeromelaban requested a review from Copilot May 12, 2025 13:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses the issue where a TextBox gets scrolled away when focused with a touch pointer by refining the snapping behavior in ScrollViewer and its associated components. Key changes include:

  • Introducing a ClampOffsetsToFocusedTextBox method for the SKIA implementation.
  • Updating snap point logic to include a new condition for snapping to a focused TextBox.
  • Adding a regression test to verify that a touch-focused TextBox remains visible.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Uno.UI/UI/Xaml/Controls/ScrollViewer/ScrollViewer.skia.cs Adds a new method to adjust offsets based on the focused TextBox.
src/Uno.UI/UI/Xaml/Controls/ScrollViewer/ScrollViewer.cs Updates presenter scrolled logic to incorporate touch TextBox snapping.
src/Uno.UI/UI/Xaml/Controls/ScrollViewer/ScrollViewer.SnapPoints.cs Applies the clamp offsets method conditionally on SKIA builds.
src/Uno.UI/UI/Xaml/Controls/ScrollContentPresenter/ScrollContentPresenter.Managed.cs Adjusts inertia behavior to correctly consider snapping when a TextBox is focused.
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_TextBox.skia.cs Introduces a new UI test ensuring a touch-focused TextBox is not scrolled away.

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 165261 has failed on Uno.UI - CI.

@jeromelaban
jeromelaban merged commit e69ee4d into unoplatform:master May 13, 2025
@ramezgerges
ramezgerges deleted the keep_touch_textbox_into_view branch May 13, 2025 13:49
DevTKSS pushed a commit to DevTKSS/uno that referenced this pull request May 31, 2025
…box_into_view

fix(textbox): keep TextBox from being scrolled away when focused with a touch pointer
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area/skia ✏️ Categorizes an issue or PR as relevant to Skia

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants