Skip to content

Cupertino Text Selection Toolbar has wrong position #154812

@ricardoboss

Description

@ricardoboss

Steps to reproduce

  1. Clone this repository: https://github.com/ricardoboss/cupertino_selection_bug
  2. Run the app on a physical iOS device (cannot reproduce in Simulator)
  3. Enter some text in the search bar
  4. Hold the text until the magnifier appears
  5. Let go of the text (the toolbar should appear at the bottom of the search field)

Expected results

The toolbar should have its arrow at the top, not at the bottom and it should be positioned a bit lower.

Actual results

The toolbar touches the edge of the text field and the arrow is on the wrong side.

Code sample

Code sample
class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return const CupertinoPageScaffold(
      navigationBar: CupertinoNavigationBar(
        middle: Text('Cupertino App'),
      ),
      child: SafeArea(
        child: Padding(
          padding: EdgeInsets.all(8.0),
          child: Column(
            children: [
              CupertinoSearchTextField(),
              Expanded(
                child: Center(
                  child: Text('Cupertino Text Selection Toolbar Bug'),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration
ScreenRecording_09-09-2024.10-56-14_1.MP4

Logs

No relevant logs.

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.24.2, on macOS 14.6.1 23G93 darwin-arm64, locale en-DE)
    • Flutter version 3.24.2 on channel stable at /Users/ricardo/repos/flutter/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4cf269e36d (5 days ago), 2024-09-03 14:30:00 -0700
    • Engine revision a6bd3f1de1
    • Dart version 3.5.2
    • DevTools version 2.37.2

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at /Users/ricardo/Library/Android/sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: /Users/ricardo/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode-15.4.0.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.1)
    • Android Studio at /Users/ricardo/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 17.0.11+0-17.0.11b1207.24-11852314)

[✓] VS Code (version 1.79.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (4 available)
    • iPad Pro 12,9“ 6th Gen (RBO) (mobile) • 00008112-0010094E0181A01E • ios            • iOS 18.0 22A5350a
    • macOS (desktop)                       • macos                     • darwin-arm64   • macOS 14.6.1 23G93 darwin-arm64
    • Mac Designed for iPad (desktop)       • mac-designed-for-ipad     • darwin         • macOS 14.6.1 23G93 darwin-arm64
    • Chrome (web)                          • chrome                    • web-javascript • Google Chrome 128.0.6613.120

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listf: cupertinoflutter/packages/flutter/cupertino repositoryfound in release: 3.24Found to occur in 3.24found in release: 3.25Found to occur in 3.25frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions