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
544527ca
Unverified
Commit
544527ca
authored
Dec 01, 2021
by
Nick Abalov
Committed by
GitHub
Dec 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip links in MinimumTapTargetGuideline. (#93869)
parent
c0da4164
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
accessibility.dart
packages/flutter_test/lib/src/accessibility.dart
+3
-0
accessibility_test.dart
packages/flutter_test/test/accessibility_test.dart
+30
-0
No files found.
packages/flutter_test/lib/src/accessibility.dart
View file @
544527ca
...
...
@@ -95,6 +95,9 @@ class MinimumTapTargetGuideline extends AccessibilityGuideline {
&&
!
data
.
hasAction
(
ui
.
SemanticsAction
.
tap
))
||
data
.
hasFlag
(
ui
.
SemanticsFlag
.
isHidden
))
return
result
;
// Skip links https://www.w3.org/WAI/WCAG21/Understanding/target-size.html
if
(
data
.
hasFlag
(
ui
.
SemanticsFlag
.
isLink
))
return
result
;
Rect
paintBounds
=
node
.
rect
;
SemanticsNode
?
current
=
node
;
while
(
current
!=
null
)
{
...
...
packages/flutter_test/test/accessibility_test.dart
View file @
544527ca
...
...
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/gestures.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
...
...
@@ -518,6 +519,35 @@ void main() {
expect
(
overlappingRightResult
.
passed
,
true
);
handle
.
dispose
();
});
testWidgets
(
'Does not fail on links'
,
(
WidgetTester
tester
)
async
{
Widget
textWithLink
()
{
return
Builder
(
builder:
(
BuildContext
context
)
{
return
RichText
(
text:
TextSpan
(
children:
<
InlineSpan
>[
const
TextSpan
(
text:
'See examples at '
,
),
TextSpan
(
text:
'flutter repo'
,
recognizer:
TapGestureRecognizer
()
..
onTap
=
()
{
},
),
],
),
);
},
);
}
final
SemanticsHandle
handle
=
tester
.
ensureSemantics
();
await
tester
.
pumpWidget
(
_boilerplate
(
textWithLink
()));
await
expectLater
(
tester
,
meetsGuideline
(
androidTapTargetGuideline
));
handle
.
dispose
();
});
});
group
(
'Labeled tappable node guideline'
,
()
{
...
...
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