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
e74fedcb
Unverified
Commit
e74fedcb
authored
Apr 22, 2020
by
Kate Lovett
Committed by
GitHub
Apr 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix InputDecorator intrinsic height reporting (#55408)
parent
8df0d686
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
1 deletion
+48
-1
input_decorator.dart
packages/flutter/lib/src/material/input_decorator.dart
+6
-1
text_field_test.dart
packages/flutter/test/material/text_field_test.dart
+42
-0
No files found.
packages/flutter/lib/src/material/input_decorator.dart
View file @
e74fedcb
...
...
@@ -1243,11 +1243,16 @@ class _RenderDecoration extends RenderBox {
double
subtextHeight
=
_lineHeight
(
width
,
<
RenderBox
>[
helperError
,
counter
]);
if
(
subtextHeight
>
0.0
)
subtextHeight
+=
subtextGap
;
return
contentPadding
.
top
final
Offset
densityOffset
=
decoration
.
visualDensity
.
baseSizeAdjustment
;
final
double
containerHeight
=
contentPadding
.
top
+
(
label
==
null
?
0.0
:
decoration
.
floatingLabelHeight
)
+
_lineHeight
(
width
,
<
RenderBox
>[
prefix
,
input
,
suffix
])
+
subtextHeight
+
contentPadding
.
bottom
;
final
double
minContainerHeight
=
decoration
.
isDense
||
expands
?
0.0
:
kMinInteractiveDimension
+
densityOffset
.
dy
;
return
math
.
max
(
containerHeight
,
minContainerHeight
);
}
@override
...
...
packages/flutter/test/material/text_field_test.dart
View file @
e74fedcb
...
...
@@ -7417,6 +7417,48 @@ void main() {
final
RenderBox
renderBox
=
tester
.
renderObject
(
find
.
byType
(
TextField
));
expect
(
renderBox
.
size
.
height
,
lessThan
(
kMinInteractiveDimension
));
});
group
(
'intrinsics'
,
()
{
Widget
_buildTest
({
bool
isDense
})
{
return
MaterialApp
(
home:
Scaffold
(
body:
CustomScrollView
(
slivers:
<
Widget
>[
SliverFillRemaining
(
hasScrollBody:
false
,
child:
Column
(
children:
<
Widget
>[
TextField
(
decoration:
InputDecoration
(
isDense:
isDense
,
)
),
Container
(
height:
1000
,
),
],
)
)
],
)
)
);
}
testWidgets
(
'By default, intrinsic height is at least kMinInteractiveDimension high'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/54729
// If the intrinsic height does not match that of the height after
// performLayout, this will fail.
tester
.
pumpWidget
(
_buildTest
(
isDense:
false
));
});
testWidgets
(
'When isDense, intrinsic height can go below kMinInteractiveDimension height'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/54729
// If the intrinsic height does not match that of the height after
// performLayout, this will fail.
tester
.
pumpWidget
(
_buildTest
(
isDense:
true
));
});
});
});
testWidgets
(
"Arrow keys don't move input focus"
,
(
WidgetTester
tester
)
async
{
final
TextEditingController
controller1
=
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