flutter icon indicating copy to clipboard operation
flutter copied to clipboard

Page Up / Page Down in text fields

Open tgucio opened this issue 3 years ago • 3 comments

This PR implements the page up/down and shift + page up/down keyboard shortcuts:

  • page up/down move caret
  • shift page up/down extend the selection by page
  • traversing text using page up/down keeps vertical text runs
  • no changes in ScrollAction

page-up-down

On macOS and iOS, the shortcuts use Alt+PageUp/Down. Without the Alt modifier, the keys scroll without moving the caret, which is implemented in PR #105497.

Pre-launch Checklist

  • [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • [x] I signed the [CLA].
  • [x] I listed at least one issue that this PR fixes in the description above.
  • [x] I updated/added relevant documentation (doc comments with ///).
  • [x] I added new tests to check the change I am making, or this PR is [test-exempt].
  • [x] All existing and new tests are passing.

tgucio avatar Jul 13 '22 23:07 tgucio

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

flutter-dashboard[bot] avatar Jul 13 '22 23:07 flutter-dashboard[bot]

/cc @justinmc @goderbauer as this is now ready for the 1st round of reviews.

tgucio avatar Jul 14 '22 07:07 tgucio

This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

flutter-dashboard[bot] avatar Aug 30 '22 21:08 flutter-dashboard[bot]

@tgucio The test failures now seem to be legitimate, can you take a look?

justinmc avatar Oct 19 '22 18:10 justinmc

@justinmc indeed, a colon was missing in one of the macOS selector names. Fixed it and this should be good to go (for another review) now.

Edit: also merged *Line and *Page action classes into one to reuse code and ensure a vertical run is continued with arrow/page dn/up presses

tgucio avatar Oct 25 '22 13:10 tgucio