Reset file input so same file can be added again after deletion
Otherwise the "change" event will not fire, since it still contains the same old value.
This commit is contained in:
parent
c09043938a
commit
5906ce5c4e
1 changed files with 6 additions and 2 deletions
|
|
@ -227,8 +227,10 @@
|
|||
<div v-if="!useVoiceMode && room && !$matrix.userCanSendMessageInCurrentRoom" class="input-area-read-only">{{ $t("message.not_allowed_to_send") }}</div>
|
||||
</v-container>
|
||||
|
||||
<input ref="attachment" type="file" name="attachment" @change="handlePickedAttachment($event)"
|
||||
accept="image/*,audio/*,video/*,.mp3,.mp4,.wav,.m4a,.pdf,application/pdf,.apk,application/vnd.android.package-archive,.ipa,.zip,application/zip,application/x-zip-compressed,multipart/x-zip" class="d-none" multiple/>
|
||||
<form ref="attachmentForm">
|
||||
<input ref="attachment" type="file" name="attachment" @change="handlePickedAttachment($event)"
|
||||
accept="image/*,audio/*,video/*,.mp3,.mp4,.wav,.m4a,.pdf,application/pdf,.apk,application/vnd.android.package-archive,.ipa,.zip,application/zip,application/x-zip-compressed,multipart/x-zip" class="d-none" multiple/>
|
||||
</form>
|
||||
|
||||
<SendAttachmentsLayout
|
||||
v-if="uploadBatch && uploadBatch.attachments.length > 0 && !useFileModeNonAdmin"
|
||||
|
|
@ -1405,6 +1407,8 @@ export default {
|
|||
*/
|
||||
handlePickedAttachment(event) {
|
||||
this.addAttachments(Object.values(event.target.files));
|
||||
// Reset value
|
||||
this.$refs.attachmentForm.reset();
|
||||
},
|
||||
|
||||
addAttachments(files) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue