Skip to content
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

Image Block: Undo includes pulsing state as an undo step #3553

Closed
2 tasks
tg-ephox opened this issue Nov 20, 2017 · 2 comments
Closed
2 tasks

Image Block: Undo includes pulsing state as an undo step #3553

tg-ephox opened this issue Nov 20, 2017 · 2 comments
Assignees
Labels
[Feature] Media Anything that impacts the experience of managing media [Type] Bug An existing feature does not function as intended

Comments

@tg-ephox
Copy link
Contributor

Issue Overview

Image Block left in uploading state (pulsing) if 'Undo' clicked after upload.

Steps to Reproduce (for bugs)

  1. Add Image block
  2. Upload Image
  3. Click Undo

Expected Behavior

Undo will revert to Placeholder Image block

Current Behavior

Undo leaves image in the uploading state (pulsing).

Possible Solution

Don't use setAttributes for temporary block state. This also means that if the browser was to be closed during uploading (which might take a while for large images) then the image blob URL will be left in the post content.

Screenshots / Video

ezgif com-video-to-gif 6

Related Issues and/or PRs

Todos

  • Tests
  • Documentation
@tg-ephox tg-ephox self-assigned this Nov 20, 2017
@tg-ephox tg-ephox added the [Type] Bug An existing feature does not function as intended label Nov 20, 2017
@karmatosed karmatosed added this to the Merge Proposal milestone Jan 25, 2018
@mtias mtias modified the milestones: Merge Proposal, WordPress 5.0 Mar 7, 2018
@mtias mtias changed the title Image Block - Image pulsing after Undo Image Block: Undo includes pulsing state as an undo step May 8, 2018
@mtias mtias added the [Feature] Media Anything that impacts the experience of managing media label May 8, 2018
@noisysocks
Copy link
Member

From my duplicate bug report which I just closed:

This also happens when the block is created by drag-and-dropping media directly into the editor. The Gallery and File blocks have similar bugs as well.

The problem is that we use the href attribute to store the blob: URL of the media that is being uploaded. This causes other related bugs, too. For example, if you refresh the page while media is uploading, the block doesn't display correctly.

We probably should be using this.setState() instead of this.props.setAttributes() to store intermittent data such as the file that is currently being uploaded. It's not clear how we would support file transforms if we do this, though.

@mcsf
Copy link
Contributor

mcsf commented Jul 22, 2018

Closing in favor of umbrella issue #8119

@mcsf mcsf closed this as completed Jul 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Media Anything that impacts the experience of managing media [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants