Skip to content

Crash while type some characters and double click in textfield: 'NSInternalInconsistencyException', reason: 'Expected a valid text range.' #138464

@randomhuangpl

Description

@randomhuangpl

Is there an existing issue for this?

Steps to reproduce

  1. type "hdjdd"
  2. double click textfield
  3. crash

work in iOS 17.0.0 well. While update to 17.1.1 crash.

Expected results

no crash

Actual results

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Expected a valid text range.'
*** First throw call stack:
(0x1a277c870 0x19aa97c00 0x1a1ce6d18 0x10af72f54 0x1a5560928 0x1a555ec90 0x1a5557724 0x1a55573ec 0x1a55539ac 0x1a54d37e0 0x1a4bc3c2c 0x1a4bc3b10 0x1a551b738 0x1a54d34a0 0x10af71a78 0x10af79d04 0x10b4fe1c8 0x10af6b590 0x10a678f50 0x10a67ab34 0x10a68afec 0x10a68aba0 0x1a26c720c 0x1a26c3f18 0x1a26c3668 0x1e5a8e5ec 0x1a4ae02b4 0x1a4adf8f0 0x104ae49cc 0x1c5116dcc)

Code sample

Code sample
class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
 
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: const Center(
        child: TextField(),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration
20231115-152259.mp4

Logs

Logs
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Expected a valid text range.'
*** First throw call stack:
(0x1a277c870 0x19aa97c00 0x1a1ce6d18 0x10af72f54 0x1a5560928 0x1a555ec90 0x1a5557724 0x1a55573ec 0x1a55539ac 0x1a54d37e0 0x1a4bc3c2c 0x1a4bc3b10 0x1a551b738 0x1a54d34a0 0x10af71a78 0x10af79d04 0x10b4fe1c8 0x10af6b590 0x10a678f50 0x10a67ab34 0x10a68afec 0x10a68aba0 0x1a26c720c 0x1a26c3f18 0x1a26c3668 0x1e5a8e5ec 0x1a4ae02b4 0x1a4adf8f0 0x104ae49cc 0x1c5116dcc)

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.13.9, on macOS 13.5.2 22G91 darwin-arm64, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.84.2)
[✓] Connected device (5 available)
[✓] Network resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsc: crashStack traces logged to the consolee: OS-version specificAffects only some versions of the relevant operating systemf: material designflutter/packages/flutter/material repository.platform-iosiOS applications specificallyteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions