Преглед изворни кода

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
+})
 ```