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
38a5bbb4
Unverified
Commit
38a5bbb4
authored
Jun 10, 2019
by
chunhtai
Committed by
GitHub
Jun 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix empty selection arrow when double clicked on empty read only textfield in ios (#34068)
parent
991da4f7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
0 deletions
+58
-0
text_selection.dart
packages/flutter/lib/src/cupertino/text_selection.dart
+4
-0
text_selection.dart
packages/flutter/lib/src/material/text_selection.dart
+5
-0
text_field_test.dart
packages/flutter/test/material/text_field_test.dart
+49
-0
No files found.
packages/flutter/lib/src/cupertino/text_selection.dart
View file @
38a5bbb4
...
...
@@ -115,6 +115,10 @@ class _TextSelectionToolbar extends StatelessWidget {
items
.
add
(
onePhysicalPixelVerticalDivider
);
items
.
add
(
_buildToolbarButton
(
localizations
.
selectAllButtonLabel
,
handleSelectAll
));
}
// If there is no option available, build an empty widget.
if
(
items
.
isEmpty
)
{
return
Container
(
width:
0.0
,
height:
0.0
);
}
const
Widget
padding
=
Padding
(
padding:
EdgeInsets
.
only
(
bottom:
10.0
));
...
...
packages/flutter/lib/src/material/text_selection.dart
View file @
38a5bbb4
...
...
@@ -49,6 +49,11 @@ class _TextSelectionToolbar extends StatelessWidget {
if
(
handleSelectAll
!=
null
)
items
.
add
(
FlatButton
(
child:
Text
(
localizations
.
selectAllButtonLabel
),
onPressed:
handleSelectAll
));
// If there is no option available, build an empty widget.
if
(
items
.
isEmpty
)
{
return
Container
(
width:
0.0
,
height:
0.0
);
}
return
Material
(
elevation:
1.0
,
child:
Container
(
...
...
packages/flutter/test/material/text_field_test.dart
View file @
38a5bbb4
...
...
@@ -854,6 +854,55 @@ void main() {
expect
(
find
.
text
(
'CUT'
),
findsNothing
);
});
testWidgets
(
'text field build empty tool bar when no options available ios'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
platform:
TargetPlatform
.
iOS
),
home:
const
Material
(
child:
TextField
(
readOnly:
true
,
),
),
)
);
await
tester
.
tap
(
find
.
byType
(
TextField
));
await
tester
.
pump
(
const
Duration
(
milliseconds:
50
));
await
tester
.
tap
(
find
.
byType
(
TextField
));
// Wait for context menu to be built.
await
tester
.
pumpAndSettle
();
final
RenderBox
container
=
tester
.
renderObject
(
find
.
descendant
(
of:
find
.
byType
(
FadeTransition
),
matching:
find
.
byType
(
Container
),
));
expect
(
container
.
size
,
Size
.
zero
);
});
testWidgets
(
'text field build empty tool bar when no options available android'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
MaterialApp
(
home:
Material
(
child:
TextField
(
readOnly:
true
,
),
),
)
);
await
tester
.
tap
(
find
.
byType
(
TextField
));
await
tester
.
pump
(
const
Duration
(
milliseconds:
50
));
await
tester
.
tap
(
find
.
byType
(
TextField
));
// Wait for context menu to be built.
await
tester
.
pumpAndSettle
();
final
RenderBox
container
=
tester
.
renderObject
(
find
.
descendant
(
of:
find
.
byType
(
FadeTransition
),
matching:
find
.
byType
(
Container
),
));
expect
(
container
.
size
,
Size
.
zero
);
});
testWidgets
(
'Sawping controllers should update selection'
,
(
WidgetTester
tester
)
async
{
TextEditingController
controller
=
TextEditingController
(
text:
'readonly'
);
final
OverlayEntry
entry
=
OverlayEntry
(
...
...
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