@@ -1632,6 +1632,44 @@ void main() {
16321632 await tester.pump (throttleDuration);
16331633 });
16341634
1635+ testWidgets ('does not reveal cursor or editor when not focused' ,
1636+ (tester) async {
1637+ final scrollController = ScrollController ();
1638+ final controller = FleatherController ();
1639+ final widget = MaterialApp (
1640+ home: SingleChildScrollView (
1641+ controller: scrollController,
1642+ child: SizedBox (
1643+ width: double .maxFinite,
1644+ child: Column (
1645+ crossAxisAlignment: CrossAxisAlignment .start,
1646+ children: [
1647+ for (var i = 0 ; i < 20 ; i++ ) ...[
1648+ FleatherField (
1649+ key: Key ('Field.Key.$i ' ),
1650+ focusNode: FocusNode (),
1651+ scrollable: false ,
1652+ autofocus: true ,
1653+ showCursor: true ,
1654+ autocorrect: false ,
1655+ enableSuggestions: false ,
1656+ controller: i == 15 ? controller : FleatherController (),
1657+ )
1658+ ]
1659+ ],
1660+ ),
1661+ ),
1662+ ),
1663+ );
1664+ await tester.pumpWidget (widget);
1665+ final initialScrollPosition = scrollController.position.pixels;
1666+ final newInput = 'Line1\n Line2' ;
1667+ controller.replaceText (0 , 0 , newInput,
1668+ selection: TextSelection .collapsed (offset: newInput.length));
1669+ await tester.pumpAndSettle (throttleDuration);
1670+ expect (scrollController.position.pixels, initialScrollPosition);
1671+ });
1672+
16351673 testWidgets (
16361674 'shows cursor on screen when not scrollable with scroll parent' ,
16371675 (tester) async {
0 commit comments