Skip to content

Conversation

@auto-submit
Copy link
Contributor

@auto-submit auto-submit bot commented Oct 22, 2024

Reverts: #156968

Initiated by: jacobsimionato

Reason for reverting: Google3 roll failing - see b/375019489

Original PR Author: bleroux

Reviewed By: {justinmc, gspencergoog}

This change reverts the following previous change:

Description

This PR makes EditableText aware of the lifecycle 'resumed' state to let the current selection unchanged when the application is resumed (on web and desktop, 'resumed' means the Flutter app window regained focus).

Before this PR, on web and desktop, the whole content of a TextField was selected whenever a TextField gained focus. This is the correct behavior when tabbing between fields but it is not when a field regains focus after the application is resumed

Related Issue

Fixes When switching to another browser tab or window and then going back, all text on TextField is selected automatically.

Tests

Adds 1 test.

@auto-submit auto-submit bot added the revert of Bot Only: Tracking label for bot. Tracks new revert of pull requests. label Oct 22, 2024
@github-actions github-actions bot added a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. labels Oct 22, 2024
@auto-submit auto-submit bot merged commit 60d4c9b into master Oct 22, 2024
@auto-submit auto-submit bot deleted the revert_383a221cf31d4d4981344c09f92b7c9956c7d0bc branch October 22, 2024 19:59
@justinmc
Copy link
Contributor

@bleroux The failure is:

'package:flutter/src/widgets/app_lifecycle_listener.dart': Failed assertion: line 253 pos 16: 'previousState == null || previousState == AppLifecycleState.hidden': Invalid state transition from AppLifecycleState.resumed to AppLifecycleState.paused

Any idea why this PR would cause that? Do we need to check mounted before assigning justResumed or something...?

@jacobsimionato
Copy link
Contributor

It was a bug in the test :-(. Sorry to revert for that reason. We can reland this change exactly as-is now that the test is fixed in the google repo.

auto-submit bot pushed a commit that referenced this pull request Oct 23, 2024
…sumed" (#157399)

## Description

Relands #156968 wich was reverted in #157378 

This PR makes `EditableText` aware of the lifecycle 'resumed' state to let the current selection unchanged when the application is resumed (on web and desktop, 'resumed' means the Flutter app window regained focus).

Before this PR, on web and desktop, the whole content of a `TextField` was selected whenever a `TextField` gained focus. This is the correct behavior when tabbing between fields but it is not when a field regains focus after the application is resumed 

## Related Issue

Fixes [When switching to another browser tab or window and then going back, all text on TextField is selected automatically](#156078).

## Tests

Adds 1 test.
@justinmc
Copy link
Contributor

Oh good news, looks like it was already relanded. Thanks!

M97Chahboun pushed a commit to M97Chahboun/flutter that referenced this pull request Oct 30, 2024
…esumed (flutter#156968)" (flutter#157378)

Reverts: flutter#156968
Initiated by: jacobsimionato
Reason for reverting: Google3 roll failing - see b/375019489
Original PR Author: bleroux

Reviewed By: {justinmc, gspencergoog}

This change reverts the following previous change:
## Description

This PR makes `EditableText` aware of the lifecycle 'resumed' state to let the current selection unchanged when the application is resumed (on web and desktop, 'resumed' means the Flutter app window regained focus).

Before this PR, on web and desktop, the whole content of a `TextField` was selected whenever a `TextField` gained focus. This is the correct behavior when tabbing between fields but it is not when a field regains focus after the application is resumed 

## Related Issue

Fixes [When switching to another browser tab or window and then going back, all text on TextField is selected automatically](flutter#156078).

## Tests

Adds 1 test.
M97Chahboun pushed a commit to M97Chahboun/flutter that referenced this pull request Oct 30, 2024
…sumed" (flutter#157399)

## Description

Relands flutter#156968 wich was reverted in flutter#157378 

This PR makes `EditableText` aware of the lifecycle 'resumed' state to let the current selection unchanged when the application is resumed (on web and desktop, 'resumed' means the Flutter app window regained focus).

Before this PR, on web and desktop, the whole content of a `TextField` was selected whenever a `TextField` gained focus. This is the correct behavior when tabbing between fields but it is not when a field regains focus after the application is resumed 

## Related Issue

Fixes [When switching to another browser tab or window and then going back, all text on TextField is selected automatically](flutter#156078).

## Tests

Adds 1 test.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 12, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. revert of Bot Only: Tracking label for bot. Tracks new revert of pull requests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TextField] When switching to another browser tab or window and then going back, all text on TextField is selected automatically

3 participants