Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

Renzo-Olivares
Copy link
Contributor

@Renzo-Olivares Renzo-Olivares commented Apr 4, 2022

When a selection is active (not collapsed) before starting to compose text, previously we would still send the composing region as the deltaRange. This was causing the new composed text to be inserted at the caret offset instead of replacing the active selection. This change adds a case to handle this situation, sending the previous composing region as the deltaRange when the selection is collapsed, and sending the selection as the deltaRange when the selection is active.

Fixes flutter/flutter#101013

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides].
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See [testing the engine] for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the [CLA].
  • All existing and new tests are passing.

Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

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

LGTM 👍

FYI the issue that you linked in the description is wrong.

@Renzo-Olivares Renzo-Olivares changed the title Fix deltas when composing and selection is active on MacOS Fix deltas when selection is active and composing begins on MacOS Apr 4, 2022
@Renzo-Olivares Renzo-Olivares merged commit 75e7cfd into flutter:main Apr 4, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 5, 2022
zanderso pushed a commit to flutter/flutter that referenced this pull request Apr 5, 2022
* 9b3117a Create `ImageFilter.dilate`/`ImageFilter.erode` (flutter/engine#32334)

* 92a6ade Roll Fuchsia Mac SDK from m_-rjFvCk... to hJaq9O7XI... (flutter/engine#32402)

* 31fd1bb Roll Fuchsia Linux SDK from 5abhmXb9Q... to WdxX5Sqix... (flutter/engine#32403)

* f088801 Roll Skia from 5215ec1ab9cd to fd9c66e18030 (1 revision) (flutter/engine#32406)

* ac21195 Fix inconsistent enum/class private member naming (flutter/engine#32409)

* 75e7cfd Fix deltas when selection is active and composing begins on MacOS (flutter/engine#32412)

* 7e5989b Fix SemanticsAction naming consistency (flutter/engine#32411)

* 1b3e9dc Fix a crash when setting clipboardData to null on iOS (flutter/engine#32413)

* ef50b28 Roll Fuchsia Linux SDK from WdxX5Sqix... to PmeDIogNb... (flutter/engine#32422)

* b48d65e Roll Fuchsia Mac SDK from hJaq9O7XI... to WBAQhRswX... (flutter/engine#32423)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[macOS] - Text deltas are buggy with special characters
2 participants