Skip to content

Field doesn't scroll on paste from keyboard #98675

Closed

Description

@justinmc

If you paste with the keyboard while the cursor is offscreen, the cursor should be scrolled into view, but it isn't.

Steps to reproduce

  1. Run any app with a multiline text field, such as the one below, on a device with a keyboard that can paste (e.g. cmd+v).
  2. Enter more lines of text than can be displayed, so that the field scrolls.
  3. Copy some text.
  4. Place the cursor at the end of the field.
  5. Scroll to the top of the field.
  6. Paste with the keyboard.

Expected: The field scrolls to bring the cursor into view.
Actual: The field seems to wobble but doesn't scroll down.

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: Scaffold(
        appBar: AppBar(
          title: const Text('Flutter Demo'),
        ),
        body: const Center(
          child: TextField(maxLines: 2),
        ),
      ),
    );
  }
}

Related: #98604 (comment)

CC @tgucio

Activity

  1. added
    a: text inputEntering text in a text field or keyboard related problems
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Feb 17, 2022
  2. added
    P2Important issues not at the top of the work list
    on Feb 17, 2022
  3. flutter-triage-bot commented on Jun 7, 2024

    @flutter-triage-bot

    The triaged-desktop label is irrelevant if there is no team-desktop label or fyi-desktop label.

  4. justinmc commented on Jun 20, 2024

    @justinmc
    ContributorAuthor

    This works for me on master on MacOS, but let me know if anyone can still reproduce it.

  5. github-actions commented on Jul 5, 2024

    @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 Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: desktopRunning on desktopa: text inputEntering text in a text field or keyboard related problemsframeworkflutter/packages/flutter repository. See also f: labels.team-text-inputOwned by Text Input teamtriaged-text-inputTriaged by Text Input team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions