diff --git a/packages/flutter/lib/src/material/input_decorator.dart b/packages/flutter/lib/src/material/input_decorator.dart index 9bdedc8787..04a3bf91f3 100644 --- a/packages/flutter/lib/src/material/input_decorator.dart +++ b/packages/flutter/lib/src/material/input_decorator.dart @@ -2150,7 +2150,7 @@ class _InputDecoratorState extends State with TickerProviderStat hintText, style: hintStyle, textDirection: decoration.hintTextDirection, - overflow: TextOverflow.ellipsis, + overflow: hintStyle.overflow ?? TextOverflow.ellipsis, textAlign: textAlign, maxLines: decoration.hintMaxLines, ), diff --git a/packages/flutter/test/material/input_decorator_test.dart b/packages/flutter/test/material/input_decorator_test.dart index a9e9201dec..99386672dc 100644 --- a/packages/flutter/test/material/input_decorator_test.dart +++ b/packages/flutter/test/material/input_decorator_test.dart @@ -6050,7 +6050,33 @@ void main() { await tester.pumpWidget(buildFrame(true)); await tester.pumpAndSettle(); expect(tester.getTopLeft(find.text('label')).dy, useMaterial3 ? -4.75 : -5.5); + }); + testWidgets('hint style overflow works', (WidgetTester tester) async { + final String hintText = 'hint text' * 20; + const TextStyle hintStyle = TextStyle( + fontFamily: 'Ahem', + fontSize: 14.0, + overflow: TextOverflow.fade, + ); + final InputDecoration decoration = InputDecoration( + hintText: hintText, + hintStyle: hintStyle, + ); + + await tester.pumpWidget( + buildInputDecorator( + useMaterial3: useMaterial3, + // isEmpty: false (default) + // isFocused: false (default) + decoration: decoration, + ), + ); + await tester.pumpAndSettle(); + + final Finder hintTextFinder = find.text(hintText); + final Text hintTextWidget = tester.widget(hintTextFinder); + expect(hintTextWidget.style!.overflow, decoration.hintStyle!.overflow); }); } }