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

Fixed Keyboard Scrolling in editors with Center or End VerticalTextAlignment is off #25827

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

NirmalKumarYuvaraj
Copy link
Contributor

@NirmalKumarYuvaraj NirmalKumarYuvaraj commented Nov 13, 2024

Issue Details

Sometimes, the editor cursor moves below the keyboard frame, causing it to render incorrectly. Once the editor content exceeds the editor's size, the cursor aligns properly above the keyboard frame.

Root Cause

The content offset of UITextView is set without consideration of keyboard frame. Causing the content to remain center even when the keyboard is open. As a result, the cursor goes below the keyboard frame.

Description of Change

The content offset of UITextView should be recalculated based on the keyboard frame value . We should check if the cursor's bottom position goes below the keyboard; we have to update the y position of the content offset based on the difference between the cursor's bottom position and the keyboard frame's top position. 

Validated the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Issues Fixed

Fixes #24977

Output

Before After
Before.mov
After.mov

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Nov 13, 2024
Copy link
Contributor

Hey there @NirmalKumarYuvaraj! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@jsuarezruiz
Copy link
Contributor

/azp run

@jsuarezruiz jsuarezruiz added area-keyboard Keyboard, soft keyboard area-controls-editor Editor labels Nov 13, 2024
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@NirmalKumarYuvaraj NirmalKumarYuvaraj marked this pull request as ready for review November 14, 2024 09:25
@NirmalKumarYuvaraj NirmalKumarYuvaraj requested a review from a team as a code owner November 14, 2024 09:25
@PureWeen
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-editor Editor area-keyboard Keyboard, soft keyboard community ✨ Community Contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Keyboard Scrolling in editors with Center or End VerticalTextAlignment is off
3 participants