You need to sign in or sign up before continuing.
License upload form doesn't update submit button state when user navigates back
Steps to reproduce:
- open
/admin/license/new
- choose "Enter license key" option and enter a random value there
- check the terms checkbox — this will enable form submission
- click the "Upload license button" — this will trigger a page reload and will display error that something is wrong with the license key
- click browser back button — you will see that the terms checkbox is checked but the submit button is disabled
This is probably related to BFCache and can be fixed with one of the following ways:
- use
autocomplete="off"
on the form - listen to 'pageshow' event and react to it
window.addEventListener('pageshow', (event) => { if (event.persisted) { showLicenseType(); toggleUploadLicenseButton(); } });
- migrating the form to Vue should probably exempt it from the caching. Related issue: #352501
More details at https://stackoverflow.com/questions/8861181/clear-all-fields-in-a-form-upon-going-back-with-browser-back-button
This patch contains two first approaches to fix the issue (it only makes sense to pick one of them):
This issue was recorded and reported by @mlunoe, here's the original recording:
Edited by Kos Palchyk