Skip to content

PageUp/PageDown in a text field #105448

Description

@justinmc

The PageUp/PageDown keys should move the cursor up/down by a bunch of lines. Currently, they don't do any thing at all.

To reproduce

  1. Run any app with a multiline text field, such as the one below.
  2. Focus the field and enter a couple of lines of text.
  3. Press PageUp.

Expected: The cursor jumps up by one page, or to the top.
Actual: Nothing happens.

Vice versa for PageDown.

Code
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            TextField(minLines: 4, maxLines: 4),
          ],
        ),
      ),
    );
  }
}

Related: It also looks like our scrollables don't properly respond to pageup/down either: #93521

Activity

  1. self-assigned this
    on Jun 7, 2022
  2. maheshj01 commented on Jun 7, 2022

    @maheshj01
    Member

    I can reproduce the issue on stable and the master channel. Pressing page up/down (fn/ctrl + Arrow keys on mac/windows) does not move the cursor as it happens in other native desktop apps.

    flutter doctor -v (mac)
    [✓] Flutter (Channel stable, 3.0.1, on macOS 12.3 21E230 darwin-arm, locale en-IN)
        • Flutter version 3.0.1 at /Users/mahesh/Documents/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision fb57da5f94 (3 days ago), 2022-05-19 15:50:29 -0700
        • Engine revision caaafc5604
        • Dart version 2.17.1
        • DevTools version 2.12.2
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
        • Android SDK at /Users/mahesh/Library/Android/sdk
        • Platform android-32, build-tools 31.0.0
        • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
        • All Android licenses accepted.
    
    [!] Xcode - develop for iOS and macOS (Xcode 13.2.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        ! CocoaPods 1.10.2 out of date (1.11.0 is recommended).
            CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin
            usage on the Dart side.
            Without CocoaPods, plugins will not work on iOS or macOS.
            For more info, see https://flutter.dev/platform-plugins
          To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2021.1)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
    
    [✓] IntelliJ IDEA Community Edition (version 2021.2.1)
        • IntelliJ at /Applications/IntelliJ IDEA CE.app
        • Flutter plugin version 61.2.4
        • Dart plugin version 212.5080.8
    
    [✓] VS Code (version 1.66.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.40.0
    
    [✓] Connected device (4 available)
        • Redmi K20 Pro (mobile) • 192.168.1.2:5555                     • android-arm64  • Android 11 (API 30)
        • iPhone 12 Pro (mobile) • 19FD0231-BFF0-441D-B584-AD94C4084525 • ios            •
          com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)
        • macOS (desktop)        • macos                                • darwin-arm64   • macOS 12.3 21E230 darwin-arm
        • Chrome (web)           • chrome                               • web-javascript • Google Chrome 101.0.4951.64
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    ! Doctor found issues in 1 category.
    
    [✓] Flutter (Channel master, 3.1.0-0.0.pre.1138, on macOS 12.3 21E230 darwin-arm, locale en-IN)
        • Flutter version 3.1.0-0.0.pre.1138 at /Users/mahesh/Documents/flutter_master
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision d9be807192 (2 hours ago), 2022-06-06 21:16:49 -0700
        • Engine revision 48864fc837
        • Dart version 2.18.0 (build 2.18.0-170.0.dev)
        • DevTools version 2.14.0
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc4)
        • Android SDK at /Users/mahesh/Library/Android/sdk
        • Platform android-32, build-tools 33.0.0-rc4
        • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • CocoaPods version 1.11.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2021.1)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
    
    [✓] IntelliJ IDEA Community Edition (version 2021.2.1)
        • IntelliJ at /Applications/IntelliJ IDEA CE.app
        • Flutter plugin version 61.2.4
        • Dart plugin version 212.5080.8
    
    [✓] VS Code (version 1.67.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.42.0
    
    [✓] Connected device (3 available)
        • sdk gphone arm64 (mobile) • emulator-5554 • android-arm64  • Android 11 (API 30) (emulator)
        • macOS (desktop)           • macos         • darwin-arm64   • macOS 12.3 21E230 darwin-arm
        • Chrome (web)              • chrome        • web-javascript • Google Chrome 102.0.5005.61
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    • No issues found!
    
  3. added
    a: text inputEntering text in a text field or keyboard related problems
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    and removed
    in triagePresently being triaged by the triage team
    on Jun 7, 2022
  4. added
    r: fixedIssue is closed as already fixed in a newer version
    on Nov 8, 2022
  5. github-actions commented on Nov 22, 2022

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  6. locked as resolved and limited conversation to collaborators on Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

a: text inputEntering text in a text field or keyboard related problemsfound in release: 3.0Found to occur in 3.0found in release: 3.1Found to occur in 3.1frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionwaiting for PR to land (fixed)A fix is in flight

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions