From 1daf70e00a2430cd64d1c89d19b1a85731a8d5c9 Mon Sep 17 00:00:00 2001 From: Amitai Burstein Date: Tue, 29 Aug 2023 23:39:21 +0300 Subject: [PATCH] Improve file upload example Uncheck the "Remove file" checkbox, in case it was previously checked. --- Guide/file-storage.markdown | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Guide/file-storage.markdown b/Guide/file-storage.markdown index bf255b98d..e6f663997 100644 --- a/Guide/file-storage.markdown +++ b/Guide/file-storage.markdown @@ -400,7 +400,10 @@ $(document).on('ready turbolinks:load', () => { $(this).closest('.file-upload-wrapper') .find('.remove-file-wrapper') - .toggleClass('hidden', !$this.val()); + .toggleClass('hidden', !$this.val()) + // Uncheck the "Remove file" checkbox, in case it was previously checked. + .find(':checkbox') + .prop('checked', false); }); // Hide the file upload wrapper if the remove file checkbox is checked.