MyBB Community Forums

Full Version: Safari browser duplicates attachments when dragged to dropzone
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Not every attachment, but frequently.

See this thread. Thanks Matt for confirming the anomalous behavior.
https://community.mybb.com/thread-232907.html
It's interesting because it runs the uploadAttachments twice so actually tries to upload the file twice. I thought this line:

Post.fileInput.val('');

may have been re-triggering addAttachments which in turn ran uploadAttachments again, but the second call to addAttachments runs before the AJAX call in uploadAttachments has completed.

Chrome vs Safari:

[attachment=44777][attachment=44776]

I can't see any other places that would trigger a change on fileInput to cause the change event to fire twice. So short of detecting the function is already running inside addAttachments/uploadAttachments, I'm not sure how we'd fix this. Only way I can think of is a if (isRunning) return; isRunning = true; type thing.
Elsewhere, it was speculated that the Safari bug was not reported since the first time.
It still exists (one report) although it might be a browser not yet updated.