You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Reverts part of "fix auto-correction highlight on top left corner (Again)" (#45523)
This reverts part of #44779. Verified this to be the regression for flutter/flutter#133908.
This pair of `textWill/DidChange` calls was added in Beta 1, in order to fix highlight region missing last character (more details [here](https://docs.google.com/document/d/1sM3HMv-SQin39yX1aPUU7vtGv7Hcef1Quc3QhRXBl6A/edit?resourcekey=0-SFYD8vmOIkXiXCZvB1Wlcw#heading=h.ddlvu2i2epyl)).
However, that fix doesn't work anymore for Beta 7 - it turns out that in Beta 7, the system doesn't rely on the `selectionRects` to determine the highlight region anymore. Instead, the system relies on `firstRectForRange` API. So we fixed the system highlight in `firstRectForRange` in Beta 7.
So even after reverting this change, the system highlight still works correctly in Beta 7. I was initially leaning towards keeping these calls even after Beta 7, because without it, the `selectionRects` are still out of sync with iOS text input system. (more details [here](https://docs.google.com/document/d/1sM3HMv-SQin39yX1aPUU7vtGv7Hcef1Quc3QhRXBl6A/edit?resourcekey=0-SFYD8vmOIkXiXCZvB1Wlcw)).
However, I was able to verify that it is indeed `textWill/DidChange` that introduced the regression for IME inputs (It's unclear why they are related, so need further investigation).
In summary, after this revert, system highlights are still in the right place, and with the right length.
*List which issues are fixed by this PR. You must list at least one issue.*
Fixesflutter/flutter#133908
*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
0 commit comments