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

Invalid UI state when pressing undo after uploading an image #8045

Closed
noisysocks opened this issue Jul 19, 2018 · 1 comment
Closed

Invalid UI state when pressing undo after uploading an image #8045

noisysocks opened this issue Jul 19, 2018 · 1 comment
Labels
[Feature] Blocks Overall functionality of blocks [Feature] Media Anything that impacts the experience of managing media [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed [Type] Bug An existing feature does not function as intended
Milestone

Comments

@noisysocks
Copy link
Member

noisysocks commented Jul 19, 2018

Describe the bug
It's possible to put the image block into a weird UI state by pressing undo after you upload an image using drag-and-drop.

To Reproduce

  1. Insert an image block
  2. Drag an image file onto the placeholder to upload it
  3. Wait until the media has finished uploading
  4. Press Undo

Expected behavior
The placeholder should be shown again. Instead, the image block pulsates as if it were still uploading.

Screenshots
image-weirdness

Desktop (please complete the following information):

  • OS: macOS 10.13.6
  • Browser: Chrome 67.0.3396.99

Additional context
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.

@noisysocks noisysocks added [Type] Bug An existing feature does not function as intended [Feature] Blocks Overall functionality of blocks [Feature] Media Anything that impacts the experience of managing media labels Jul 19, 2018
@noisysocks noisysocks added this to the Merge Proposal: Editor milestone Jul 19, 2018
@noisysocks
Copy link
Member Author

Oops, this is a dupe of #3553.

@designsimply designsimply added the [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed label Jul 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [Feature] Media Anything that impacts the experience of managing media [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants