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 active storage firefox #30568

Merged
merged 1 commit into from Sep 13, 2017

Conversation

Projects
None yet
2 participants
@lazaronixon
Contributor

lazaronixon commented Sep 11, 2017

Summary

Direct upload on firefox is not working because it can’t handle click
events on “input[type=submit]”.
After a successful upload we can see on console a xml parse error, it
happens because AWS S3 success body response is empty, so changing the
reponseType suppress this error.

Other Information

Xml parse error on console is not a problem, it works without problem.
If i use button.focus() before button.click() it works too, but on next lines of code we have a condition to insert a hidden input[submit] tag and again firefox cant click hidden input[submit] tags

@@ -7,6 +7,7 @@ export class BlobUpload {
this.xhr = new XMLHttpRequest
this.xhr.open("PUT", url, true)
this.xhr.responseType = "text"

This comment has been minimized.

@lazaronixon

lazaronixon Sep 11, 2017

Contributor

Suppress xml parser error on console

@lazaronixon

lazaronixon Sep 11, 2017

Contributor

Suppress xml parser error on console

Show outdated Hide outdated activestorage/app/javascript/activestorage/ujs.js
Show outdated Hide outdated activestorage/app/javascript/activestorage/ujs.js
Show outdated Hide outdated activestorage/app/javascript/activestorage/ujs.js
@lazaronixon

This comment has been minimized.

Show comment
Hide comment
@lazaronixon

lazaronixon Sep 12, 2017

Contributor

Seems focus solved the problem... I tested second case without focus and it works too...

Contributor

lazaronixon commented Sep 12, 2017

Seems focus solved the problem... I tested second case without focus and it works too...

@javan

This comment has been minimized.

Show comment
Hide comment
@javan

javan Sep 12, 2017

Member

Can you squash your commits, please?

Member

javan commented Sep 12, 2017

Can you squash your commits, please?

Fix activestorage direct upload on firefox
Direct upload on firefox is not working because it can’t handle click
events on “input[type=submit]”.
After a successful upload we can see on console a xml parse error, it
happens because AWS S3 success body response is empty, so changing the
reponseType suppress this error.
@javan

javan approved these changes Sep 13, 2017

@javan javan merged commit 38b3af7 into rails:master Sep 13, 2017

2 checks passed

codeclimate All good!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@javan

This comment has been minimized.

Show comment
Hide comment
@javan

javan Sep 13, 2017

Member

Thank you!

Member

javan commented Sep 13, 2017

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment