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
24e7a0be
Unverified
Commit
24e7a0be
authored
Jan 24, 2024
by
yim
Committed by
GitHub
Jan 24, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't change the height of the Textfield's labelStyle when it focused. (#141943)
Fixes #141448
parent
be031cb9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
2 deletions
+27
-2
input_decorator.dart
packages/flutter/lib/src/material/input_decorator.dart
+2
-2
input_decorator_test.dart
packages/flutter/test/material/input_decorator_test.dart
+25
-0
No files found.
packages/flutter/lib/src/material/input_decorator.dart
View file @
24e7a0be
...
...
@@ -2123,9 +2123,9 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
return
themeData
.
textTheme
.
titleMedium
!
.
merge
(
widget
.
baseStyle
)
.
copyWith
(
height:
1
)
.
merge
(
defaultTextStyle
)
.
merge
(
style
);
.
merge
(
style
)
.
copyWith
(
height:
1
);
}
TextStyle
_getHelperStyle
(
ThemeData
themeData
,
InputDecorationTheme
defaults
)
{
...
...
packages/flutter/test/material/input_decorator_test.dart
View file @
24e7a0be
...
...
@@ -7022,4 +7022,29 @@ testWidgets('OutlineInputBorder with BorderRadius.zero should draw a rectangular
reason:
'clamp is expected'
,
);
});
testWidgets
(
'Ensure the height of labelStyle remains unchanged when TextField is focused.'
,
(
WidgetTester
tester
)
async
{
final
FocusNode
focusNode
=
FocusNode
();
addTearDown
(
focusNode
.
dispose
);
final
ThemeData
theme
=
ThemeData
(
useMaterial3:
true
);
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
theme
,
home:
Material
(
child:
TextField
(
focusNode:
focusNode
,
decoration:
const
InputDecoration
(
labelText:
'label'
,
),
),
),
),
);
final
TextStyle
beforeStyle
=
getLabelStyle
(
tester
);
// Focused.
focusNode
.
requestFocus
();
await
tester
.
pumpAndSettle
();
expect
(
getLabelStyle
(
tester
).
height
,
beforeStyle
.
height
);
});
}
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