Skip to content

Conversation

Renzo-Olivares
Copy link
Contributor

@Renzo-Olivares Renzo-Olivares commented Aug 3, 2022

This change continues @doppio work from #95644.

On iOS, a single tap on the previous selection should toggle the toolbar. This change accomplishes that, and also when a tap occurs within a previous selection, the selection should stay the same. For example if there is a non collapsed selection, and we tap on it, this should toggle the toolbar and keep the selection. Previously the selection would move to the word edge closest to the tapped position.

iOS toggle toolbar on non-collapsed selection iOS toggle toolbar on collapsed selection
Screen Recording 2022-08-03 at 2 09 56 PM Screen Recording 2022-08-03 at 2 12 28 PM
Flutter Before Flutter After
Screen Recording 2022-08-03 at 2 29 51 PM Screen Recording 2022-08-03 at 2 26 42 PM

Fixes b/173627308 and #48434

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], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • All existing and new tests are passing.

Renzo Olivares added 2 commits August 3, 2022 12:38
… a single tap on within the previous selection should not change it
@flutter-dashboard flutter-dashboard bot added a: text input Entering text in a text field or keyboard related problems f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Aug 3, 2022
@flutter-dashboard flutter-dashboard bot added the f: cupertino flutter/packages/flutter/cupertino repository label Aug 3, 2022
@Renzo-Olivares Renzo-Olivares marked this pull request as ready for review August 4, 2022 20:32
@Renzo-Olivares Renzo-Olivares requested a review from justinmc August 4, 2022 20:32
@Renzo-Olivares
Copy link
Contributor Author

cc: @chunhtai if you have any thoughts on this solution since global selection should probably do something similar.

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 👍 I think you and I had nearly the same exact approach.

);

return renderEditable.selection!.start < textPosition.offset
&& renderEditable.selection!.end > textPosition.offset;
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this work if the selection is collapsed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Talked offline about not handling ==.

The reason I didn't handle the == case is because say we have hello world with world selected, and we want to tap at the edge of world to collapse the selection and move the cursor to the end of the field. Because we handle == we can't do that and the selection stays on world.

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 15, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Aug 15, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 15, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Aug 15, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 15, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Aug 15, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 15, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Aug 15, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 15, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Aug 15, 2022
stuartmorgan-g pushed a commit to flutter/plugins that referenced this pull request Aug 16, 2022
* 7d1323c Updating expiring cirrus key. (flutter/flutter#109461)

* a85902a Roll Flutter Engine from de118a55ade0 to c354e0e04cea (2 revisions) (flutter/flutter#109462)

* 28de3d4 Roll Flutter Engine from c354e0e04cea to d1b18b5d6811 (1 revision) (flutter/flutter#109466)

* a624cb7 Keep `dirty` manipulations private to `Element` base class (flutter/flutter#109401)

* dce82f7 Remove deprecated Ruby File.exists? in helper script (flutter/flutter#109428)

* 7887ca5 Revert "Keep `dirty` manipulations private to `Element` base class (#109401)" (flutter/flutter#109481)

* 237a298 Roll Flutter Engine from d1b18b5d6811 to a2f3bd58ce73 (1 revision) (flutter/flutter#109472)

* fe2fc8d Single tap on the previous selection should toggle the toolbar on iOS… (flutter/flutter#108913)

* 696c6fb Roll Flutter Engine from a2f3bd58ce73 to fb19700742c3 (6 revisions) (flutter/flutter#109482)

* 17bc0ce Roll Flutter Engine from fb19700742c3 to 2180e62f6c7e (1 revision) (flutter/flutter#109483)

* 4265015 Roll Flutter Engine from 2180e62f6c7e to cd1a1cb757f5 (1 revision) (flutter/flutter#109488)

* c142dd3 Roll Flutter Engine from cd1a1cb757f5 to 5cc5c5f04f0a (1 revision) (flutter/flutter#109490)

* 8a55c36 Roll Flutter Engine from 5cc5c5f04f0a to 18dca3de7496 (2 revisions) (flutter/flutter#109493)

* d50c5b1 Roll Flutter Engine from 18dca3de7496 to 83771593cb55 (1 revision) (flutter/flutter#109505)

* 97901da Cleaner test.dart output. (flutter/flutter#109206)

* fb3c8ea Roll Flutter Engine from 83771593cb55 to f49a617535af (1 revision) (flutter/flutter#109509)

* 5fcd9c2 Update README.md (flutter/flutter#109506)

* 4dd7065 Add onOpened callback to PopupMenuButton (flutter/flutter#103753)

* ed3238e Roll Flutter Engine from f49a617535af to cc9f4c63b7e5 (1 revision) (flutter/flutter#109518)

* 8b1ca3f Roll Flutter Engine from cc9f4c63b7e5 to 4656c2f46cad (1 revision) (flutter/flutter#109524)

* 20ffb32 Roll Flutter Engine from 4656c2f46cad to 16fb19e72f88 (1 revision) (flutter/flutter#109526)

* 087750f Roll Flutter Engine from 16fb19e72f88 to 9c3c233e2639 (1 revision) (flutter/flutter#109532)

* 4aba124 Roll Flutter Engine from 9c3c233e2639 to f0c3829e90ce (1 revision) (flutter/flutter#109536)

* 2bce108 Roll Plugins from 9fb7654 to 094f1c3 (7 revisions) (flutter/flutter#109543)

* 97d9a2f Roll Flutter Engine from f0c3829e90ce to 8c019cdd446f (2 revisions) (flutter/flutter#109548)

* 458d618 Roll Flutter Engine from 8c019cdd446f to 198b0051a5a2 (1 revision) (flutter/flutter#109552)

* c873c21 Roll Flutter Engine from 198b0051a5a2 to 33fccf564973 (1 revision) (flutter/flutter#109557)
camsim99 pushed a commit to camsim99/plugins that referenced this pull request Aug 23, 2022
* 7d1323c Updating expiring cirrus key. (flutter/flutter#109461)

* a85902a Roll Flutter Engine from de118a55ade0 to c354e0e04cea (2 revisions) (flutter/flutter#109462)

* 28de3d4 Roll Flutter Engine from c354e0e04cea to d1b18b5d6811 (1 revision) (flutter/flutter#109466)

* a624cb7 Keep `dirty` manipulations private to `Element` base class (flutter/flutter#109401)

* dce82f7 Remove deprecated Ruby File.exists? in helper script (flutter/flutter#109428)

* 7887ca5 Revert "Keep `dirty` manipulations private to `Element` base class (#109401)" (flutter/flutter#109481)

* 237a298 Roll Flutter Engine from d1b18b5d6811 to a2f3bd58ce73 (1 revision) (flutter/flutter#109472)

* fe2fc8d Single tap on the previous selection should toggle the toolbar on iOS… (flutter/flutter#108913)

* 696c6fb Roll Flutter Engine from a2f3bd58ce73 to fb19700742c3 (6 revisions) (flutter/flutter#109482)

* 17bc0ce Roll Flutter Engine from fb19700742c3 to 2180e62f6c7e (1 revision) (flutter/flutter#109483)

* 4265015 Roll Flutter Engine from 2180e62f6c7e to cd1a1cb757f5 (1 revision) (flutter/flutter#109488)

* c142dd3 Roll Flutter Engine from cd1a1cb757f5 to 5cc5c5f04f0a (1 revision) (flutter/flutter#109490)

* 8a55c36 Roll Flutter Engine from 5cc5c5f04f0a to 18dca3de7496 (2 revisions) (flutter/flutter#109493)

* d50c5b1 Roll Flutter Engine from 18dca3de7496 to 83771593cb55 (1 revision) (flutter/flutter#109505)

* 97901da Cleaner test.dart output. (flutter/flutter#109206)

* fb3c8ea Roll Flutter Engine from 83771593cb55 to f49a617535af (1 revision) (flutter/flutter#109509)

* 5fcd9c2 Update README.md (flutter/flutter#109506)

* 4dd7065 Add onOpened callback to PopupMenuButton (flutter/flutter#103753)

* ed3238e Roll Flutter Engine from f49a617535af to cc9f4c63b7e5 (1 revision) (flutter/flutter#109518)

* 8b1ca3f Roll Flutter Engine from cc9f4c63b7e5 to 4656c2f46cad (1 revision) (flutter/flutter#109524)

* 20ffb32 Roll Flutter Engine from 4656c2f46cad to 16fb19e72f88 (1 revision) (flutter/flutter#109526)

* 087750f Roll Flutter Engine from 16fb19e72f88 to 9c3c233e2639 (1 revision) (flutter/flutter#109532)

* 4aba124 Roll Flutter Engine from 9c3c233e2639 to f0c3829e90ce (1 revision) (flutter/flutter#109536)

* 2bce108 Roll Plugins from 9fb7654 to 094f1c3 (7 revisions) (flutter/flutter#109543)

* 97d9a2f Roll Flutter Engine from f0c3829e90ce to 8c019cdd446f (2 revisions) (flutter/flutter#109548)

* 458d618 Roll Flutter Engine from 8c019cdd446f to 198b0051a5a2 (1 revision) (flutter/flutter#109552)

* c873c21 Roll Flutter Engine from 198b0051a5a2 to 33fccf564973 (1 revision) (flutter/flutter#109557)
moisefeelin pushed a commit to feelinproject/plugins that referenced this pull request Aug 26, 2022
* 7d1323c Updating expiring cirrus key. (flutter/flutter#109461)

* a85902a Roll Flutter Engine from de118a55ade0 to c354e0e04cea (2 revisions) (flutter/flutter#109462)

* 28de3d4 Roll Flutter Engine from c354e0e04cea to d1b18b5d6811 (1 revision) (flutter/flutter#109466)

* a624cb7 Keep `dirty` manipulations private to `Element` base class (flutter/flutter#109401)

* dce82f7 Remove deprecated Ruby File.exists? in helper script (flutter/flutter#109428)

* 7887ca5 Revert "Keep `dirty` manipulations private to `Element` base class (#109401)" (flutter/flutter#109481)

* 237a298 Roll Flutter Engine from d1b18b5d6811 to a2f3bd58ce73 (1 revision) (flutter/flutter#109472)

* fe2fc8d Single tap on the previous selection should toggle the toolbar on iOS… (flutter/flutter#108913)

* 696c6fb Roll Flutter Engine from a2f3bd58ce73 to fb19700742c3 (6 revisions) (flutter/flutter#109482)

* 17bc0ce Roll Flutter Engine from fb19700742c3 to 2180e62f6c7e (1 revision) (flutter/flutter#109483)

* 4265015 Roll Flutter Engine from 2180e62f6c7e to cd1a1cb757f5 (1 revision) (flutter/flutter#109488)

* c142dd3 Roll Flutter Engine from cd1a1cb757f5 to 5cc5c5f04f0a (1 revision) (flutter/flutter#109490)

* 8a55c36 Roll Flutter Engine from 5cc5c5f04f0a to 18dca3de7496 (2 revisions) (flutter/flutter#109493)

* d50c5b1 Roll Flutter Engine from 18dca3de7496 to 83771593cb55 (1 revision) (flutter/flutter#109505)

* 97901da Cleaner test.dart output. (flutter/flutter#109206)

* fb3c8ea Roll Flutter Engine from 83771593cb55 to f49a617535af (1 revision) (flutter/flutter#109509)

* 5fcd9c2 Update README.md (flutter/flutter#109506)

* 4dd7065 Add onOpened callback to PopupMenuButton (flutter/flutter#103753)

* ed3238e Roll Flutter Engine from f49a617535af to cc9f4c63b7e5 (1 revision) (flutter/flutter#109518)

* 8b1ca3f Roll Flutter Engine from cc9f4c63b7e5 to 4656c2f46cad (1 revision) (flutter/flutter#109524)

* 20ffb32 Roll Flutter Engine from 4656c2f46cad to 16fb19e72f88 (1 revision) (flutter/flutter#109526)

* 087750f Roll Flutter Engine from 16fb19e72f88 to 9c3c233e2639 (1 revision) (flutter/flutter#109532)

* 4aba124 Roll Flutter Engine from 9c3c233e2639 to f0c3829e90ce (1 revision) (flutter/flutter#109536)

* 2bce108 Roll Plugins from 9fb7654 to 094f1c3 (7 revisions) (flutter/flutter#109543)

* 97d9a2f Roll Flutter Engine from f0c3829e90ce to 8c019cdd446f (2 revisions) (flutter/flutter#109548)

* 458d618 Roll Flutter Engine from 8c019cdd446f to 198b0051a5a2 (1 revision) (flutter/flutter#109552)

* c873c21 Roll Flutter Engine from 198b0051a5a2 to 33fccf564973 (1 revision) (flutter/flutter#109557)
@ChristianEdwardPadilla
Copy link

Can we roll this back? Seems it is causing crashes: #111660.

godofredoc added a commit that referenced this pull request Sep 15, 2022
Renzo-Olivares pushed a commit to Renzo-Olivares/flutter that referenced this pull request Nov 28, 2022
mauricioluz pushed a commit to mauricioluz/plugins that referenced this pull request Jan 26, 2023
* 7d1323c Updating expiring cirrus key. (flutter/flutter#109461)

* a85902a Roll Flutter Engine from de118a55ade0 to c354e0e04cea (2 revisions) (flutter/flutter#109462)

* 28de3d4 Roll Flutter Engine from c354e0e04cea to d1b18b5d6811 (1 revision) (flutter/flutter#109466)

* a624cb7 Keep `dirty` manipulations private to `Element` base class (flutter/flutter#109401)

* dce82f7 Remove deprecated Ruby File.exists? in helper script (flutter/flutter#109428)

* 7887ca5 Revert "Keep `dirty` manipulations private to `Element` base class (#109401)" (flutter/flutter#109481)

* 237a298 Roll Flutter Engine from d1b18b5d6811 to a2f3bd58ce73 (1 revision) (flutter/flutter#109472)

* fe2fc8d Single tap on the previous selection should toggle the toolbar on iOS… (flutter/flutter#108913)

* 696c6fb Roll Flutter Engine from a2f3bd58ce73 to fb19700742c3 (6 revisions) (flutter/flutter#109482)

* 17bc0ce Roll Flutter Engine from fb19700742c3 to 2180e62f6c7e (1 revision) (flutter/flutter#109483)

* 4265015 Roll Flutter Engine from 2180e62f6c7e to cd1a1cb757f5 (1 revision) (flutter/flutter#109488)

* c142dd3 Roll Flutter Engine from cd1a1cb757f5 to 5cc5c5f04f0a (1 revision) (flutter/flutter#109490)

* 8a55c36 Roll Flutter Engine from 5cc5c5f04f0a to 18dca3de7496 (2 revisions) (flutter/flutter#109493)

* d50c5b1 Roll Flutter Engine from 18dca3de7496 to 83771593cb55 (1 revision) (flutter/flutter#109505)

* 97901da Cleaner test.dart output. (flutter/flutter#109206)

* fb3c8ea Roll Flutter Engine from 83771593cb55 to f49a617535af (1 revision) (flutter/flutter#109509)

* 5fcd9c2 Update README.md (flutter/flutter#109506)

* 4dd7065 Add onOpened callback to PopupMenuButton (flutter/flutter#103753)

* ed3238e Roll Flutter Engine from f49a617535af to cc9f4c63b7e5 (1 revision) (flutter/flutter#109518)

* 8b1ca3f Roll Flutter Engine from cc9f4c63b7e5 to 4656c2f46cad (1 revision) (flutter/flutter#109524)

* 20ffb32 Roll Flutter Engine from 4656c2f46cad to 16fb19e72f88 (1 revision) (flutter/flutter#109526)

* 087750f Roll Flutter Engine from 16fb19e72f88 to 9c3c233e2639 (1 revision) (flutter/flutter#109532)

* 4aba124 Roll Flutter Engine from 9c3c233e2639 to f0c3829e90ce (1 revision) (flutter/flutter#109536)

* 2bce108 Roll Plugins from 9fb7654 to 094f1c3 (7 revisions) (flutter/flutter#109543)

* 97d9a2f Roll Flutter Engine from f0c3829e90ce to 8c019cdd446f (2 revisions) (flutter/flutter#109548)

* 458d618 Roll Flutter Engine from 8c019cdd446f to 198b0051a5a2 (1 revision) (flutter/flutter#109552)

* c873c21 Roll Flutter Engine from 198b0051a5a2 to 33fccf564973 (1 revision) (flutter/flutter#109557)
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 autosubmit Merge PR when tree becomes green via auto submit App 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.

3 participants