Repository navigation
Cut/Copy/Paste buttons for CupertinoTextField do not respect SafeArea #25632
Copy link
Copy link
Closed
Labels
a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.p: cupertino_uicupertino_ui package in flutter/packagescupertino_ui package in flutter/packages
Description
Steps to Reproduce
I have this code in an otherwise empty project:
import 'package:flutter/cupertino.dart';
void main() {
runApp(CupertinoApp(
home: SafeArea(
child: Column(
children: [
SearchBar(),
Expanded(
child: Container(),
),
],
),
),
));
}
class SearchBar extends StatelessWidget {
final TextEditingController controller;
final FocusNode focusNode;
SearchBar({
@required this.controller,
@required this.focusNode,
});
@override
Widget build(BuildContext context) {
return DecoratedBox(
decoration: BoxDecoration(
color: CupertinoColors.lightBackgroundGray,
borderRadius: BorderRadius.circular(10.0),
),
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 4.0,
vertical: 8.0,
),
child: Row(
children: [
Icon(
CupertinoIcons.search,
color: Color(0xff808080),
),
Expanded(
child: CupertinoTextField(
controller: controller,
focusNode: focusNode,
cursorColor: CupertinoColors.activeBlue,
),
),
GestureDetector(
onTap: () {
controller.clear();
},
child: Icon(
CupertinoIcons.clear_thick_circled,
color: Color(0xff000000),
),
),
],
),
),
);
}
}- Start app on a device with a notch (I used an XS Max sim).
- Tap into the text field.
- Add a bunch of random characters.
- Double-tap on the string of characters to highlight a selection.
- Notice that the cut/copy/paste tooltips are obscured by the notch.
Logs
$ flutter doctor -v
[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.13.6 17G3025, locale en-US)
• Flutter version 1.0.0 at /Users/redbrogdon/Library/flutter
• Framework revision 5391447fae (3 weeks ago), 2018-11-29 19:41:26 -0800
• Engine revision 7375a0f414
• Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at /Users/redbrogdon/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.3
• ANDROID_HOME = /Users/redbrogdon/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.0, Build version 10A255
• ios-deploy 1.9.4
• CocoaPods version 1.5.3
[✓] Android Studio (version 3.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 27.1.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
[✓] IntelliJ IDEA Community Edition (version 2018.3.1)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin version 31.1.4
• Dart plugin version 183.4733
[✓] Connected device (1 available)
• iPhone XS Max • 33CDC891-E0C9-4EA2-AB0C-D7D0DACB0834 • ios • iOS 12.0 (simulator)
• No issues found!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.p: cupertino_uicupertino_ui package in flutter/packagescupertino_ui package in flutter/packages

Activity
xster commentedon Jan 4, 2019
Since it's technically the same solution, I'm gonna dupe into #3945
github-actions commentedon Aug 14, 2021
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 -vand a minimal reproduction of the issue.