Remove deprecated RenderEditable.onSelectionChanged#98582
Remove deprecated RenderEditable.onSelectionChanged#98582fluttergithubbot merged 8 commits intoflutter:masterfrom
Conversation
|
There are some framework tests here that need to be updated |
|
Also remove the deprecated TextSelectionDelegate setter textEditingValue in this PR, they are related. |
This comment was marked as outdated.
This comment was marked as outdated.
| affinity: fromPosition.affinity, | ||
| ); | ||
| final bool focusingEmpty = newSelection.baseOffset == 0 && newSelection.extentOffset == 0 && !hasFocus; | ||
| if (newSelection == selection && cause != SelectionChangedCause.keyboard && !focusingEmpty) { |
There was a problem hiding this comment.
why does it need to check for other condition if the selection is the same?
There was a problem hiding this comment.
I am not sure, I found this change that introduced this: #29563
cc @mdebbar
It was only calling onSelectionChanged under those circumstances.
Without this change, this test from that change fails:
However, I notice it now causes another failure, so there may be a bug here. One test was expecting one thing from the old API, and the other test is expecting something else from the new API.
There was a problem hiding this comment.
The old pr only introduce the equal check
if (newSelection != _selection) which makes sense to me, but what about the cause != SelectionChangedCause.keyboard && !focusingEmpty
There was a problem hiding this comment.
I assumed the logic in _handleSelectionChange was necessary, so I carried it over to the new API. It probably was modified by other changes after #29563. Let me see if removing the keyboard and focus part still passes the existing test.
There was a problem hiding this comment.
🙏 Thanks for tracing those back @mdebbar! So I think this is indeed intentional behavior, I am looking at the other test now that is broken here by carrying the logic over.
There was a problem hiding this comment.
https://github.com/flutter/flutter/pull/29809/files is where the test came from, the cupertino one is broken, while the same material test passes, so we may be missing something in cupertino text field.
|
Touched base with @justinmc, it looks like the flickering bug #29563 fixed does not exist with the new API. As I understand it, the repeated calls to onSelectionChanged caused the flickering, and so removing |
This removes
onSelectionChangedfromRenderEditableThis deprecated property has reached end of life after the release of Flutter 2.10
textSelectionDelegate.userUpdateTextEditingValue.Part of #98537
For the full list of deprecations being removed in this batch, see flutter.dev/go/deprecations-removed-after-2-10
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.