You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: input, typed value is cleared when navigating back in Safari #30017
I have searched for existing issues that already report this problem, without success.
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
yarn or npm i for install dependencies
yarn start or npm run start to serve app on 0.0.0.0:4200
open {host}:4200 with safari on iphone (tested on iphone 13 and iphone 8)
click on "open pdf" link (safari will open pdf file in the same tab)
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:
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
Activity
ZeroDX255 commentedon Nov 27, 2024
Some addition: the bug is gone if I set
autocompleteattribute.thetaPC commentedon Nov 10, 2026
Thanks for the report, and sorry for the delay.
Verified on 9.0.10.
ion-inputsetsautocomplete="off"on its inner input by default, and Safari clears everyautocomplete="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 noautocomplete. Safari also leavesion-input's value holding the old text, so a form can submit a value the field no longer shows.As you found, setting
autocompleteto any value other thanoffkeeps the text:Tracked as a bug in
core.[-]bug: [angular ios] IonInput value disappears after viewing PDF on safari[/-][+]bug: input, typed value is cleared when navigating back in Safari[/+]fix(input, searchbar): sync value after Safari back navigation (ionic…