-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix uploading same file twice in a row in Chromium #4550
Merged
PVince81
merged 1 commit into
master
from
fix-uploading-same-file-twice-in-a-row-in-chromium
Nov 9, 2020
Merged
Fix uploading same file twice in a row in Chromium #4550
PVince81
merged 1 commit into
master
from
fix-uploading-same-file-twice-in-a-row-in-chromium
Nov 9, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To upload files a hidden file input is "clicked", which shows the browser dialog to pick the files, and the "change" event of the file input is listened to to know the selected files. However, although Firefox always emits the "change" event when files are selected, Chromium only emits the "change" event if the selected files have changed since the last time. Due to this if a file was uploaded and then the same file was tried to be uploaded again nothing happened. Now the value of the file input is cleared (which also clears the files from the file input) after the files are handled to ensure that there is no previous state when the browser dialog is shown again, and thus the selected files always change. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
danxuliu
added
3. to review
bug
feature: frontend 🖌️
"Web UI" client
feature: upload & shares & voice 📤🎙️
Sharing files into a chat and audio recordings
labels
Nov 6, 2020
/backport to stable20 |
/backport to stable19 |
PVince81
approved these changes
Nov 6, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested with Chromium, works 👍
skjnldsv
approved these changes
Nov 6, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 🙏
Fixes #3904 |
PVince81
deleted the
fix-uploading-same-file-twice-in-a-row-in-chromium
branch
November 9, 2020 10:14
This was referenced Nov 9, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3. to review
bug
feature: frontend 🖌️
"Web UI" client
feature: upload & shares & voice 📤🎙️
Sharing files into a chat and audio recordings
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To upload files a hidden file input is "clicked", which shows the browser dialog to pick the files, and the
change
event of the file input is listened to to know the selected files.However, although Firefox always emits the
change
event when files are selected, Chromium only emits thechange
event if the selected files have changed since the last time. Due to this if a file was uploaded and then the same file was tried to be uploaded again nothing happened.Now the value of the file input is cleared (which also clears the files from the file input) after the files are handled to ensure that there is no previous state when the browser dialog is shown again, and thus the selected files always change.
How to test
Result with this pull request
The Talk dialog to confirm the files is shown and the file can be uploaded.
Result without this pull request
The browser dialog to select the files is shown, but not the Talk dialog to confirm the files.