Thanks to visit codestin.com
Credit goes to github.com

Skip to content

PageUp/PageDown in a text field #105448

Closed
@justinmc

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

Metadata

Metadata

Assignees

Labels

a: text inputEntering text in a text field or keyboard related problemsf: material designflutter/packages/flutter/material repository.found 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 onr: 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