Repository navigation
Closed as duplicate
Closed as duplicate
Copy link
Labels
a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsfound in release: 3.29Found to occur in 3.29Found to occur in 3.29found in release: 3.31Found to occur in 3.31Found to occur in 3.31has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesplatform-macosBuilding on or for macOS specificallyBuilding on or for macOS specificallyr: duplicateIssue is closed as a duplicate of an existing issueIssue is closed as a duplicate of an existing issueteam-text-inputOwned by Text Input teamOwned by Text Input team
Description
Steps to reproduce
- Create a Column with focusable widgets e.g. FilledButton and a TextField
- Set
textAlign: TextAlign.rightorend - Use the up/down arrow or tab key leave the widget
Expected results
A widget in the desired direction get the keyboard focus
Actual results
The "old" widget keeps the focus
Code sample
Code sample
MaterialApp(
home: Scaffold(
body: Center(
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
mainAxisSize: MainAxisSize.min,
spacing: 16,
children: [
Text('Use the arrow keys (up/down) to cause the bug'),
FilledButton(onPressed: () {}, child: Text('aaa')),
TextField(autofocus: true, textAlign: TextAlign.right),
FilledButton(onPressed: () {}, child: Text('bbb')),
],
),
),
),
),
)Screenshots or Video
Screenshots / Video demonstration
bug.mov
Logs
Logs
======== Exception caught by services library ======================================================
The following assertion was thrown during method call TextInputClient.performSelectors:
'package:flutter/src/rendering/editable.dart': Failed assertion: line 218 pos 12: 'isValid': is not true.
Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=2_bug.yml
When the exception was thrown, this was the stack:
#2 VerticalCaretMovementRun.movePrevious (package:flutter/src/rendering/editable.dart:218:12)
#3 _UpdateTextSelectionVerticallyAction.invoke (package:flutter/src/widgets/editable_text.dart:6394:26)
#4 _OverridableContextAction.invokeDefaultAction (package:flutter/src/widgets/actions.dart:1812:28)
#5 _OverridableActionMixin.invoke (package:flutter/src/widgets/actions.dart:1671:15)
#6 Action._invoke (package:flutter/src/widgets/actions.dart:334:45)
#7 ActionDispatcher.invokeAction (package:flutter/src/widgets/actions.dart:641:19)
#8 Actions.invoke.<anonymous closure> (package:flutter/src/widgets/actions.dart:965:48)
#9 Actions._visitActionsAncestors (package:flutter/src/widgets/actions.dart:747:18)
#10 Actions.invoke (package:flutter/src/widgets/actions.dart:959:30)
#11 EditableTextState.performSelector (package:flutter/src/widgets/editable_text.dart:4999:17)
#12 ListBase.forEach (dart:collection/list.dart:51:13)
#13 TextInput._handleTextInputInvocation (package:flutter/src/services/text_input.dart:2009:19)
#14 TextInput._loudlyHandleTextInputInvocation (package:flutter/src/services/text_input.dart:1866:20)
#15 MethodChannel._handleAsMethodCall (package:flutter/src/services/platform_channel.dart:611:55)
#16 MethodChannel.setMethodCallHandler.<anonymous closure> (package:flutter/src/services/platform_channel.dart:601:55)
#17 _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:650:35)
#18 _invoke2 (dart:ui/hooks.dart:348:13)
#19 _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:45:5)
#20 _Channel.push (dart:ui/channel_buffers.dart:136:31)
#21 ChannelBuffers.push (dart:ui/channel_buffers.dart:344:17)
#22 PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:786:22)
#23 _dispatchPlatformMessage (dart:ui/hooks.dart:262:31)
(elided 2 frames from class _AssertionError)
call: MethodCall(TextInputClient.performSelectors, [2, [moveUp:]])
====================================================================================================
======== Exception caught by services library ======================================================
The following assertion was thrown during method call TextInputClient.performSelectors:
'package:flutter/src/rendering/editable.dart': Failed assertion: line 203 pos 12: 'isValid': is not true.
Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=2_bug.yml
When the exception was thrown, this was the stack:
#2 VerticalCaretMovementRun.moveNext (package:flutter/src/rendering/editable.dart:203:12)
#3 _UpdateTextSelectionVerticallyAction.invoke (package:flutter/src/widgets/editable_text.dart:6393:26)
#4 _OverridableContextAction.invokeDefaultAction (package:flutter/src/widgets/actions.dart:1812:28)
#5 _OverridableActionMixin.invoke (package:flutter/src/widgets/actions.dart:1671:15)
#6 Action._invoke (package:flutter/src/widgets/actions.dart:334:45)
#7 ActionDispatcher.invokeAction (package:flutter/src/widgets/actions.dart:641:19)
#8 Actions.invoke.<anonymous closure> (package:flutter/src/widgets/actions.dart:965:48)
#9 Actions._visitActionsAncestors (package:flutter/src/widgets/actions.dart:747:18)
#10 Actions.invoke (package:flutter/src/widgets/actions.dart:959:30)
#11 EditableTextState.performSelector (package:flutter/src/widgets/editable_text.dart:4999:17)
#12 ListBase.forEach (dart:collection/list.dart:51:13)
#13 TextInput._handleTextInputInvocation (package:flutter/src/services/text_input.dart:2009:19)
#14 TextInput._loudlyHandleTextInputInvocation (package:flutter/src/services/text_input.dart:1866:20)
#15 MethodChannel._handleAsMethodCall (package:flutter/src/services/platform_channel.dart:611:55)
#16 MethodChannel.setMethodCallHandler.<anonymous closure> (package:flutter/src/services/platform_channel.dart:601:55)
#17 _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:650:35)
#18 _invoke2 (dart:ui/hooks.dart:348:13)
#19 _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:45:5)
#20 _Channel.push (dart:ui/channel_buffers.dart:136:31)
#21 ChannelBuffers.push (dart:ui/channel_buffers.dart:344:17)
#22 PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:786:22)
#23 _dispatchPlatformMessage (dart:ui/hooks.dart:262:31)
(elided 2 frames from class _AssertionError)
call: MethodCall(TextInputClient.performSelectors, [2, [moveDown:]])
====================================================================================================Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.29.2, on macOS 15.3.2 24D81 darwin-arm64, locale de-DE) [2,1s]
• Flutter version 3.29.2 on channel stable at /Users/rekire/dev/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision c236373904 (vor 13 Tagen), 2025-03-13 16:17:06 -0400
• Engine revision 18b71d647a
• Dart version 3.7.2
• DevTools version 2.42.3
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [2,1s]
• Android SDK at /Users/rekire/Library/Android/sdk
• Platform android-35, build-tools 35.0.0
• Java binary at: /Users/rekire/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 16.2) [2,4s]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16C5032a
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [95ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2024.3) [95ms]
• Android Studio at /Users/rekire/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 21.0.5+-12932927-b750.29)
[✓] IntelliJ IDEA Community Edition (version 2024.3.3) [93ms]
• IntelliJ at /Users/rekire/Applications/IntelliJ IDEA Community Edition.app
• Flutter plugin version 83.0.4
• Dart plugin version 243.23654.44
[✓] VS Code (version 1.92.2) [9ms]
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.90.0
[✓] Connected device (4 available) [11,8s]
• Pixel 6 (mobile) • 36261FDF6S1R3L • android-arm64 • Android 15 (API 35)
• macOS (desktop) • macos • darwin-arm64 • macOS 15.3.2 24D81 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 15.3.2 24D81 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 134.0.6998.166
! Error: Browsing on the local area network for iPhone von Fast. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources [576ms]
• All expected network resources are available.
• No issues found!Metadata
Metadata
Assignees
Labels
a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsfound in release: 3.29Found to occur in 3.29Found to occur in 3.29found in release: 3.31Found to occur in 3.31Found to occur in 3.31has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesplatform-macosBuilding on or for macOS specificallyBuilding on or for macOS specificallyr: duplicateIssue is closed as a duplicate of an existing issueIssue is closed as a duplicate of an existing issueteam-text-inputOwned by Text Input teamOwned by Text Input team
Activity
maheshj01 commentedon Mar 27, 2025
@rekire Thanks for filing the issue. I am not really sure I understood the issue. Do you mean when the input is focused and switched to other apps and the focus stays? Can you please update the reproducible steps.
rekire commentedon Mar 27, 2025
When you remove the alignment right part, you can use the arrow keys to move the keyboard focus to the buttons aaa or bbb depending if you press or or down.
maheshj01 commentedon Mar 27, 2025
Thanks for the clarification, Reproducible on stable and the master channel. When Arrow keys are pressed assertion error is thrown. This reproduces onall platforms except the web.
Screen.Recording.2025-03-27.at.15.19.43.mov
steps to reproduce
code sample
logs (master)
flutter doctor -v
master
stable
[-]Cannot leave TextField via keyboard when textAlign = .right[/-][+]TextField with `TextAlign.right` throws Failed assertion: line 218 pos 12: 'isValid': is not true.[/+]justinmc commentedon Mar 27, 2025
CC @LongCatIsLooong from triage, you thought this was a duplicate.
rekire commentedon Mar 27, 2025
JFYI this also happens on Windows
Doctor output
LongCatIsLooong commentedon Mar 27, 2025
Duplicate of #139201.
TextAlign.rightthrowsFailed assertion: line 206 pos 12: 'isValid': is not true.#139201github-actions commentedon Apr 10, 2025
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.