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
f268f820
Unverified
Commit
f268f820
authored
Jan 04, 2022
by
LongCatIsLooong
Committed by
GitHub
Jan 04, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix autofill eligibility check (#95210)
parent
5b6de035
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
1 deletion
+52
-1
editable_text.dart
packages/flutter/lib/src/widgets/editable_text.dart
+1
-1
editable_text_test.dart
packages/flutter/test/widgets/editable_text_test.dart
+51
-0
No files found.
packages/flutter/lib/src/widgets/editable_text.dart
View file @
f268f820
...
...
@@ -2191,7 +2191,7 @@ class EditableTextState extends State<EditableText> with AutomaticKeepAliveClien
bool
get
_hasInputConnection
=>
_textInputConnection
?.
attached
??
false
;
/// Whether to send the autofill information to the autofill service. True by
/// default.
bool
get
_needsAutofill
=>
widget
.
autofillHints
?.
isNotEmpty
??
true
;
bool
get
_needsAutofill
=>
_effectiveAutofillClient
.
textInputConfiguration
.
autofillConfiguration
.
enabled
;
void
_openInputConnection
()
{
if
(!
_shouldCreateInputConnection
)
{
...
...
packages/flutter/test/widgets/editable_text_test.dart
View file @
f268f820
...
...
@@ -6585,6 +6585,7 @@ void main() {
'TextInput.setStyle'
,
'TextInput.setEditingState'
,
'TextInput.show'
,
'TextInput.requestAutofill'
,
'TextInput.setEditingState'
,
'TextInput.show'
,
'TextInput.setCaretRect'
,
...
...
@@ -6648,6 +6649,7 @@ void main() {
'TextInput.setStyle'
,
'TextInput.setEditingState'
,
'TextInput.show'
,
'TextInput.requestAutofill'
,
'TextInput.setCaretRect'
,
];
expect
(
...
...
@@ -6690,6 +6692,7 @@ void main() {
'TextInput.setStyle'
,
'TextInput.setEditingState'
,
'TextInput.show'
,
'TextInput.requestAutofill'
,
'TextInput.setEditingState'
,
'TextInput.show'
,
'TextInput.setCaretRect'
,
...
...
@@ -6740,6 +6743,7 @@ void main() {
'TextInput.setStyle'
,
'TextInput.setEditingState'
,
'TextInput.show'
,
'TextInput.requestAutofill'
,
'TextInput.setEditingState'
,
'TextInput.show'
,
'TextInput.setCaretRect'
,
...
...
@@ -8974,6 +8978,53 @@ void main() {
await
tester
.
pump
();
expect
(
scrollController
.
offset
.
roundToDouble
(),
0.0
);
});
testWidgets
(
'Autofill enabled by default'
,
(
WidgetTester
tester
)
async
{
final
FocusNode
focusNode
=
FocusNode
();
await
tester
.
pumpWidget
(
MaterialApp
(
home:
EditableText
(
autofocus:
true
,
controller:
TextEditingController
(
text:
'A'
),
focusNode:
focusNode
,
style:
textStyle
,
cursorColor:
Colors
.
blue
,
backgroundCursorColor:
Colors
.
grey
,
cursorOpacityAnimates:
true
,
),
),
);
assert
(
focusNode
.
hasFocus
);
expect
(
tester
.
testTextInput
.
log
,
contains
(
matchesMethodCall
(
'TextInput.requestAutofill'
)),
);
});
testWidgets
(
'Autofill can be disabled'
,
(
WidgetTester
tester
)
async
{
final
FocusNode
focusNode
=
FocusNode
();
await
tester
.
pumpWidget
(
MaterialApp
(
home:
EditableText
(
autofocus:
true
,
controller:
TextEditingController
(
text:
'A'
),
focusNode:
focusNode
,
style:
textStyle
,
cursorColor:
Colors
.
blue
,
backgroundCursorColor:
Colors
.
grey
,
cursorOpacityAnimates:
true
,
autofillHints:
null
,
),
),
);
assert
(
focusNode
.
hasFocus
);
expect
(
tester
.
testTextInput
.
log
,
isNot
(
contains
(
matchesMethodCall
(
'TextInput.requestAutofill'
))),
);
});
}
class
UnsettableController
extends
TextEditingController
{
...
...
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