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

Improving TextBox behaviour on Ctrl+Backspace down event #14138

Merged
merged 7 commits into from
Jan 9, 2024

Conversation

exGensImpl
Copy link
Contributor

@exGensImpl exGensImpl commented Jan 8, 2024

What does the pull request do?

This PR improves TextBox behaviour on Ctrl+Backspace gesture down event

What is the current behavior?

  • After deletion, TextBox doesn't change the caret position accordingly to the text shift
  • If the caret position is set to the end of a word, TextBox doesn't remove a whitespace before the deleting word, which results in a double space at its place after deletion
  • When undoing a deletion, TextBox doesn't reset the caret position to the place before deletion

What is the updated/expected behavior with this PR?

  • After deletion, TextBox sets the caret position to the start of the deleted word
  • If the caret position is set to the end of a word, TextBox removes a whitespace before the deleting word
  • When undoing a deletion, TextBox resets the caret position to the place before deletion

Checklist

  • Added unit tests (if possible)?

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.1.999-cibuild0043349-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@exGensImpl exGensImpl changed the title Umproving TextBox behaviour on Ctrl+Backspace down event Improving TextBox behaviour on Ctrl+Backspace down event Jan 8, 2024
@Gillibald Gillibald self-requested a review January 8, 2024 04:54
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.1.999-cibuild0043402-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@Gillibald Gillibald added the backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch label Jan 9, 2024
@Takoooooo Takoooooo added this pull request to the merge queue Jan 9, 2024
Merged via the queue into AvaloniaUI:master with commit ac0f903 Jan 9, 2024
6 checks passed
@maxkatz6 maxkatz6 added backported-11.0.x and removed backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch labels Jan 17, 2024
maxkatz6 pushed a commit that referenced this pull request Jan 17, 2024
* Test: TextBox Ctrl+Back caret position

* Fixed: TextBox Ctrl+Back caret position

* Test: TextBox Ctrl+Back remove double whitespace

* Fixed: TextBox Ctrl+Back remove double whitespace

* Test: TextBox Ctrl+Back undo return caret position

* Fixed: TextBox Ctrl+Back undo return caret position
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants