Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
69495255
Unverified
Commit
69495255
authored
Jan 24, 2022
by
LongCatIsLooong
Committed by
GitHub
Jan 24, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show keyboard after text input connection restarts (#96541)
parent
5f118018
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
+44
-0
editable_text.dart
packages/flutter/lib/src/widgets/editable_text.dart
+1
-0
editable_text_test.dart
packages/flutter/test/widgets/editable_text_test.dart
+43
-0
No files found.
packages/flutter/lib/src/widgets/editable_text.dart
View file @
69495255
...
...
@@ -2311,6 +2311,7 @@ class EditableTextState extends State<EditableText> with AutomaticKeepAliveClien
final
TextStyle
style
=
widget
.
style
;
newConnection
..
show
()
..
setStyle
(
fontFamily:
style
.
fontFamily
,
fontSize:
style
.
fontSize
,
...
...
packages/flutter/test/widgets/editable_text_test.dart
View file @
69495255
...
...
@@ -2194,6 +2194,49 @@ void main() {
])));
});
testWidgets
(
'requesting focus in the onSubmitted callback should keep the onscreen keyboard visible'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/95154 .
final
Widget
widget
=
MaterialApp
(
home:
EditableText
(
backgroundCursorColor:
Colors
.
grey
,
style:
Typography
.
material2018
().
black
.
subtitle1
!,
cursorColor:
Colors
.
blue
,
focusNode:
focusNode
,
controller:
controller
,
onSubmitted:
(
String
value
)
{
focusNode
.
requestFocus
();
},
),
);
await
tester
.
pumpWidget
(
widget
);
focusNode
.
requestFocus
();
await
tester
.
pump
();
assert
(
focusNode
.
hasFocus
);
tester
.
testTextInput
.
log
.
clear
();
// This will attempt to unfocus the field but the onSubmitted callback
// will cancel that. Restart the input connection in this case.
await
tester
.
testTextInput
.
receiveAction
(
TextInputAction
.
done
);
expect
(
tester
.
testTextInput
.
log
,
containsAllInOrder
(<
Matcher
>[
matchesMethodCall
(
'TextInput.clearClient'
),
matchesMethodCall
(
'TextInput.setClient'
),
matchesMethodCall
(
'TextInput.show'
),
]));
tester
.
testTextInput
.
log
.
clear
();
// TextInputAction.unspecified does not unfocus the input field by default.
await
tester
.
testTextInput
.
receiveAction
(
TextInputAction
.
unspecified
);
expect
(
tester
.
testTextInput
.
log
,
isNot
(
containsAllInOrder
(<
Matcher
>[
matchesMethodCall
(
'TextInput.clearClient'
),
matchesMethodCall
(
'TextInput.setClient'
),
matchesMethodCall
(
'TextInput.show'
),
])));
});
testWidgets
(
'iOS autocorrection rectangle should appear on demand and dismiss when the text changes or when focus is lost'
,
(
WidgetTester
tester
)
async
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment