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
067d3da8
Unverified
Commit
067d3da8
authored
Jul 13, 2020
by
chunhtai
Committed by
GitHub
Jul 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Adds semantics information for the popup menu item (#61258)" (#61377)
This reverts commit
c6058df9
.
parent
c6058df9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
158 deletions
+10
-158
popup_menu.dart
packages/flutter/lib/src/material/popup_menu.dart
+5
-9
popup_menu_test.dart
packages/flutter/test/material/popup_menu_test.dart
+5
-149
No files found.
packages/flutter/lib/src/material/popup_menu.dart
View file @
067d3da8
...
...
@@ -342,15 +342,11 @@ class PopupMenuItemState<T, W extends PopupMenuItem<T>> extends State<W> {
},
);
return
Semantics
(
enabled:
widget
.
enabled
,
button:
true
,
child:
InkWell
(
onTap:
widget
.
enabled
?
handleTap
:
null
,
canRequestFocus:
widget
.
enabled
,
mouseCursor:
effectiveMouseCursor
,
child:
item
,
),
return
InkWell
(
onTap:
widget
.
enabled
?
handleTap
:
null
,
canRequestFocus:
widget
.
enabled
,
mouseCursor:
effectiveMouseCursor
,
child:
item
,
);
}
}
...
...
packages/flutter/test/material/popup_menu_test.dart
View file @
067d3da8
...
...
@@ -765,175 +765,31 @@ void main() {
],
children:
<
TestSemantics
>[
TestSemantics
(
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isButton
,
SemanticsFlag
.
hasEnabledState
,
SemanticsFlag
.
isEnabled
,
SemanticsFlag
.
isFocusable
,
],
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isFocusable
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
label:
'1'
,
textDirection:
TextDirection
.
ltr
,
),
TestSemantics
(
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isButton
,
SemanticsFlag
.
hasEnabledState
,
SemanticsFlag
.
isEnabled
,
SemanticsFlag
.
isFocusable
,
],
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isFocusable
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
label:
'2'
,
textDirection:
TextDirection
.
ltr
,
),
TestSemantics
(
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isButton
,
SemanticsFlag
.
hasEnabledState
,
SemanticsFlag
.
isEnabled
,
SemanticsFlag
.
isFocusable
,
],
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isFocusable
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
label:
'3'
,
textDirection:
TextDirection
.
ltr
,
),
TestSemantics
(
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isButton
,
SemanticsFlag
.
hasEnabledState
,
SemanticsFlag
.
isEnabled
,
SemanticsFlag
.
isFocusable
,
],
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isFocusable
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
label:
'4'
,
textDirection:
TextDirection
.
ltr
,
),
TestSemantics
(
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isButton
,
SemanticsFlag
.
hasEnabledState
,
SemanticsFlag
.
isEnabled
,
SemanticsFlag
.
isFocusable
,
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
label:
'5'
,
textDirection:
TextDirection
.
ltr
,
),
],
),
],
),
],
),
TestSemantics
(),
],
),
],
),
ignoreId:
true
,
ignoreTransform:
true
,
ignoreRect:
true
,
));
semantics
.
dispose
();
});
testWidgets
(
'disabled PopupMenuItem has correct semantics'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/45044.
final
SemanticsTester
semantics
=
SemanticsTester
(
tester
);
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Material
(
child:
PopupMenuButton
<
int
>(
itemBuilder:
(
BuildContext
context
)
{
return
<
PopupMenuItem
<
int
>>[
const
PopupMenuItem
<
int
>(
value:
1
,
child:
Text
(
'1'
)),
const
PopupMenuItem
<
int
>(
value:
2
,
enabled:
false
,
child:
Text
(
'2'
)),
const
PopupMenuItem
<
int
>(
value:
3
,
child:
Text
(
'3'
)),
const
PopupMenuItem
<
int
>(
value:
4
,
child:
Text
(
'4'
)),
const
PopupMenuItem
<
int
>(
value:
5
,
child:
Text
(
'5'
)),
];
},
child:
const
SizedBox
(
height:
100.0
,
width:
100.0
,
child:
Text
(
'XXX'
),
),
),
),
),
);
await
tester
.
tap
(
find
.
text
(
'XXX'
));
await
tester
.
pumpAndSettle
();
expect
(
semantics
,
hasSemantics
(
TestSemantics
.
root
(
children:
<
TestSemantics
>[
TestSemantics
(
textDirection:
TextDirection
.
ltr
,
children:
<
TestSemantics
>[
TestSemantics
(
children:
<
TestSemantics
>[
TestSemantics
(
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
scopesRoute
,
SemanticsFlag
.
namesRoute
,
],
label:
'Popup menu'
,
textDirection:
TextDirection
.
ltr
,
children:
<
TestSemantics
>[
TestSemantics
(
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
hasImplicitScrolling
,
],
children:
<
TestSemantics
>[
TestSemantics
(
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isButton
,
SemanticsFlag
.
hasEnabledState
,
SemanticsFlag
.
isEnabled
,
SemanticsFlag
.
isFocusable
,
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
label:
'1'
,
textDirection:
TextDirection
.
ltr
,
),
TestSemantics
(
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isButton
,
SemanticsFlag
.
hasEnabledState
,
],
actions:
<
SemanticsAction
>[],
label:
'2'
,
textDirection:
TextDirection
.
ltr
,
),
TestSemantics
(
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isButton
,
SemanticsFlag
.
hasEnabledState
,
SemanticsFlag
.
isEnabled
,
SemanticsFlag
.
isFocusable
,
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
label:
'3'
,
textDirection:
TextDirection
.
ltr
,
),
TestSemantics
(
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isButton
,
SemanticsFlag
.
hasEnabledState
,
SemanticsFlag
.
isEnabled
,
SemanticsFlag
.
isFocusable
,
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
label:
'4'
,
textDirection:
TextDirection
.
ltr
,
),
TestSemantics
(
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isButton
,
SemanticsFlag
.
hasEnabledState
,
SemanticsFlag
.
isEnabled
,
SemanticsFlag
.
isFocusable
,
],
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isFocusable
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
label:
'5'
,
textDirection:
TextDirection
.
ltr
,
...
...
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