Skip to content

Save password prompt dismiss is pushing UI up and down #112281

@rsp-84

Description

@rsp-84

Steps to Reproduce

  1. Launch a flutter application with a login form (email/pw).
  2. Fill out the form, submit and navigate to another page.
  3. On iOS (I observed this on iOS 15+), dismiss the prompt.
    ** On the machine I ran, it currently has flutter 2 however, when upgraded to flutter 3, the same behavior is present. And appears only to affect iOS.

Expected results: The prompt should dismiss from the widget leaving the underlying page unmodified.

Actual results: After being dismissed, the contents on the widget is being pushed up and down.

Code sample Simplified widgets to show the issue:
import 'package:exampleapp/widgets/simple_page.dart';
import 'package:flutter/material.dart';

class AutoFillPwWork extends StatefulWidget {
  const AutoFillPwWork({Key? key}) : super(key: key);

  @override
  State<AutoFillPwWork> createState() => _AutoFillPwWorkState();
}

class _AutoFillPwWorkState extends State<AutoFillPwWork> {
  final TextEditingController email = TextEditingController();
  final TextEditingController password = TextEditingController();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: const Text('Save PW iOS'),
        ),
        body: ListView(
          children: <Widget>[
            const Text('Login'),
            AutofillGroup(
              child: Column(
                children: <Widget>[
                  TextField(
                    controller: email,
                    autofillHints: const <String>[AutofillHints.email],
                  ),
                  TextField(
                    controller: password,
                    autofillHints: const <String>[AutofillHints.password],
                  ),
                ],
              ),
            ),
            ElevatedButton(
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(builder: (context) => const SimplePage()),
                );
              },
              child: const Text('Push SimplePage'),
            ),
          ],
        ));
  }
}

import 'package:flutter/material.dart';

class SimplePage extends StatelessWidget {
  const SimplePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.red,
      appBar: AppBar(
        title: const Text('Simple Page'),
      ),
      body: Center(
        child: Container(
          color: Colors.blue,
          child: const Text('Simple Page'),
        ),
      ),
    );
  }
}
Details Flutter (Channel unknown, 2.10.1, on macOS 11.6.8 20G730 darwin-x64, locale en-US) • Flutter version 2.10.1 at /Users/user/Development/flutter • Upstream repository unknown • Framework revision db747aa (8 months ago), 2022-02-09 13:57:35 -0600 • Engine revision ab46186 • Dart version 2.16.1 • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/user/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.3

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] VS Code (version 1.71.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.48.0

[✓] Connected device (2 available)
• iPhone (mobile) • ios • iOS 15.7 19H12
• Chrome (web) • chrome • web-javascript • Google Chrome 105.0.5195.125

[✓] HTTP Host Availability
• All required HTTP hosts are available

save_pw_issue.MP4

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsc: regressionIt was better in the past than it is nowengineflutter/engine related. See also e: labels.f: material designflutter/packages/flutter/material repository.found in release: 3.19Found to occur in 3.19found in release: 3.3Found to occur in 3.3found in release: 3.4Found to occur in 3.4frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions