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
91f8d3da
Unverified
Commit
91f8d3da
authored
Jan 16, 2020
by
rami-a
Committed by
GitHub
Jan 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent disabled cupertino textfield from being edited with voiceover/talkback (#48902)
parent
4c1d79f4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
1 deletion
+59
-1
text_field.dart
packages/flutter/lib/src/cupertino/text_field.dart
+2
-1
text_field_test.dart
packages/flutter/test/cupertino/text_field_test.dart
+57
-0
No files found.
packages/flutter/lib/src/cupertino/text_field.dart
View file @
91f8d3da
...
...
@@ -929,7 +929,8 @@ class _CupertinoTextFieldState extends State<CupertinoTextField> with AutomaticK
);
return
Semantics
(
onTap:
()
{
enabled:
enabled
,
onTap:
!
enabled
?
null
:
()
{
if
(!
controller
.
selection
.
isValid
)
{
controller
.
selection
=
TextSelection
.
collapsed
(
offset:
controller
.
text
.
length
);
}
...
...
packages/flutter/test/cupertino/text_field_test.dart
View file @
91f8d3da
...
...
@@ -3944,4 +3944,61 @@ void main() {
await
tester
.
pump
();
expect
(
focusNode3
.
hasPrimaryFocus
,
isTrue
);
});
testWidgets
(
'Cupertino text field semantics'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
CupertinoApp
(
home:
Center
(
child:
ConstrainedBox
(
constraints:
BoxConstraints
.
loose
(
const
Size
(
200
,
200
)),
child:
const
CupertinoTextField
(),
),
),
),
);
expect
(
tester
.
getSemantics
(
find
.
descendant
(
of:
find
.
byType
(
CupertinoTextField
),
matching:
find
.
byType
(
Semantics
),
).
first
,
),
matchesSemantics
(
isTextField:
true
,
isEnabled:
true
,
hasEnabledState:
true
,
hasTapAction:
true
,
),
);
});
testWidgets
(
'Disabled Cupertino text field semantics'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
CupertinoApp
(
home:
Center
(
child:
ConstrainedBox
(
constraints:
BoxConstraints
.
loose
(
const
Size
(
200
,
200
)),
child:
const
CupertinoTextField
(
enabled:
false
,
),
),
),
),
);
expect
(
tester
.
getSemantics
(
find
.
descendant
(
of:
find
.
byType
(
CupertinoTextField
),
matching:
find
.
byType
(
Semantics
),
).
first
,
),
matchesSemantics
(
isEnabled:
false
,
hasEnabledState:
true
,
hasTapAction:
false
,
),
);
});
}
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