Преглед на файлове

add note to file-input docs about clearing the custom inpit

https://github.com/transloadit/uppy/issues/2640
Artur Paikin преди 4 години
родител
ревизия
0a7c8a45e2
променени са 1 файла, в които са добавени 11 реда и са изтрити 0 реда
  1. 11 0
      website/src/docs/fileinput.md

+ 11 - 0
website/src/docs/fileinput.md

@@ -128,4 +128,15 @@ fileInput.addEventListener('change', (event) => {
     }
   })
 })
+
+// it’s probably a good idea to clear the `<input>`
+// after the upload or when the file was removed
+// (see https://github.com/transloadit/uppy/issues/2640#issuecomment-731034781)
+uppy.on('file-removed', () => {
+  fileInput.value = null
+})
+
+uppy.on('complete', () => {
+  fileInput.value = null
+})
 ```