Skip to content

Conversation

@justinmc
Copy link
Contributor

@justinmc justinmc commented May 6, 2022

Previously, right clicking to focus a field for the second time caused an error. Because the selection doesn't actually change (it's already been initialized from -1,-1 to something like 0,0), Flutter wasn't selecting the field or building the selection overlay, which caused the error when it tried to show the overlay.

This PR focuses the field and builds the overlay even if selection doesn't change.

In the "Old behavior" gif, notice how the first field's menu isn't shown and it isn't focused the second time I right click on it. An error is logged at that point.

Old behavior New behavior
out out

Fixes #99707

@flutter-dashboard flutter-dashboard 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 May 6, 2022
@justinmc justinmc force-pushed the right-click-input-again branch from 939a0f2 to 4839500 Compare May 16, 2022 23:17
@justinmc justinmc force-pushed the right-click-input-again branch from 4839500 to 7d0f4a2 Compare May 16, 2022 23:19
@justinmc justinmc marked this pull request as ready for review May 17, 2022 00:09
@flutter-dashboard flutter-dashboard bot added f: cupertino flutter/packages/flutter/cupertino repository f: material design flutter/packages/flutter/material repository. labels May 17, 2022
Copy link
Contributor

@Renzo-Olivares Renzo-Olivares left a comment

Choose a reason for hiding this comment

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

LGTM

@fluttergithubbot fluttergithubbot merged commit 384800b into flutter:master May 19, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 19, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request May 19, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request May 19, 2022
@justinmc justinmc deleted the right-click-input-again branch May 19, 2022 16:51
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request May 21, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 30, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Aug 30, 2022
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 f: cupertino flutter/packages/flutter/cupertino repository f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TextField context menus do not show after focus switch

3 participants