Skip to content

bug: input, typed value is cleared when navigating back in Safari #30017

Closed

Description

@ZeroDX255

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

The value entered in an IonInput field disappears after the user returns from viewing a PDF document. This occurs when navigating away from the page containing the IonInput to view the PDF, and then navigating back to the original page.

Expected Behavior

The expected behavior is for the IonInput to retain its value

Steps to Reproduce

  1. yarn or npm i for install dependencies
  2. yarn start or npm run start to serve app on 0.0.0.0:4200
  3. open {host}:4200 with safari on iphone (tested on iphone 13 and iphone 8)
  4. click on "open pdf" link (safari will open pdf file in the same tab)
  5. return back

Code Reproduction URL

https://github.com/ZeroDX255/ion-input-bug-showcase

Ionic Info

Ionic:

Ionic CLI : 7.2.0 (C:\Users\igor-\AppData\Local\Yarn\Data\global\node_modules@ionic\cli)
Ionic Framework : @ionic/angular 8.4.0
@angular-devkit/build-angular : 18.2.11
@angular-devkit/schematics : 17.3.11
@angular/cli : 18.2.11
@ionic/angular-toolkit : 11.0.1

Capacitor:

Capacitor CLI : 6.1.2
@capacitor/android : not installed
@capacitor/core : 6.1.2
@capacitor/ios : not installed

Utility:

cordova-res : not installed globally
native-run : 2.0.1

System:

NodeJS : v20.17.0 (C:\Program Files\nodejs\node.exe)
npm : 10.8.2
OS : Windows 10

Additional Information

No response

Activity

  1. ZeroDX255 commented on Nov 27, 2024

    @ZeroDX255
    Author

    Some addition: the bug is gone if I set autocomplete attribute.

  2. thetaPC commented on Nov 10, 2026

    @thetaPC
    Contributor

    Thanks for the report, and sorry for the delay.

    Verified on 9.0.10. ion-input sets autocomplete="off" on its inner input by default, and Safari clears every autocomplete="off" field when you go back to a page it restored from its back/forward cache. Chrome and Firefox keep the text, and so does a plain <input> with no autocomplete. Safari also leaves ion-input's value holding the old text, so a form can submit a value the field no longer shows.

    As you found, setting autocomplete to any value other than off keeps the text:

    <ion-input autocomplete="on"></ion-input>

    Tracked as a bug in core.

  3. changed the title [-]bug: [angular ios] IonInput value disappears after viewing PDF on safari[/-] [+]bug: input, typed value is cleared when navigating back in Safari[/+] on Nov 10, 2026
  4. added
    package: core
    type: bug
    on Nov 10, 2026
  5. added a commit that references this issue on Nov 17, 2026
    f8f25bc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: coretype: bug

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions