Skip to content

Figure out why renderEditable can be null in EditableTextState userUpdateTextEditingValue #79818

Closed

Description

@chunhtai

repro

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

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    const title = 'code sample';
    return MaterialApp(
      title: title,
      home: Scaffold(
        body: HomeWidget(),
      ),
    );
  }
}

class HomeWidget extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return Home();
  }
}

class Home extends State<StatefulWidget> {
  UniqueKey key;
  void onPressed() {
    setState(() {
      key = UniqueKey();
    });
  }
  FocusNode node = FocusNode();
  TextEditingController controller = TextEditingController();
  @override
  Widget build(BuildContext context) {
    node.requestFocus();
    return Scaffold(
      appBar: AppBar(actions: [IconButton(onPressed: onPressed, icon: Icon(Icons.add))],),
      body:ListView(
        children: [
          TextField(key:key,focusNode: node, controller: controller),
        ],
      ));
  }
}
  1. click + icon multiple time
  2. type something into the textfield using raw keyboard
  3. type delete

b/184470009
b/183416650

Activity

  1. added
    a: text inputEntering text in a text field or keyboard related problems
    c: crashStack traces logged to the console
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Apr 5, 2021
  2. self-assigned this
    on Apr 6, 2021
  3. github-actions commented on Aug 3, 2021

    @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.

  4. locked as resolved and limited conversation to collaborators on Aug 3, 2021
  5. added
    P0Critical issues such as a build break or regression
    and removed on Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P0Critical issues such as a build break or regressiona: text inputEntering text in a text field or keyboard related problemsc: crashStack traces logged to the consolecustomer: money (g3)frameworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions