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

Bug: Image element src not in sync when replaced with other media #10192

Closed
littlemilkstudio opened this issue Jan 13, 2022 · 1 comment · Fixed by #10206
Closed

Bug: Image element src not in sync when replaced with other media #10192

littlemilkstudio opened this issue Jan 13, 2022 · 1 comment · Fixed by #10206
Assignees
Labels
Elements: Image Group: Canvas P2 Should do soon Package: Story Editor /packages/story-editor Type: Bug Something isn't working Type: Code Quality Things that need a refactor, rewrite or just some good old developer ❤️

Comments

@littlemilkstudio
Copy link
Contributor

Found in this thread here once we fixed some bugs with the animation provider:
#10024 (comment)

When replacing an image element with new media, the src remains on the old resource while the srcset updates to the new resource.

Visually there are no issues because the browser pulls the currentSrc from the srcset instead of the src, but src resource shouldn't get out of sync with the active resource.

Completion of this ticket involves updating story-editor/src/elements/media/imageDisplay.js to maintain the active resource as its src and to re-enable these karma tests to make sure they're passing:

  • should correctly copy image to page with existing image
  • should correctly handle image dragged from library straight to edge replacing old image
  • should correctly handle image dropped on edge replacing old image
  • should replace top image when bg image is set and another one is on top
  • should replace the top image when two images are in the same place on canvas

This behavior can't be seen on the canvas until this PR is merged, but you can view it on main right now in the carousel page preview after replacing media of an element:
#10024

@littlemilkstudio littlemilkstudio added Package: Story Editor /packages/story-editor Type: Bug Something isn't working labels Jan 13, 2022
@miina miina added P2 Should do soon Type: Code Quality Things that need a refactor, rewrite or just some good old developer ❤️ labels Jan 14, 2022
@miina miina removed their assignment Jan 14, 2022
@miina
Copy link
Contributor

miina commented Jan 14, 2022

@merapi I'm adding this to Ready for Sprint right now, leaving you assigned in case you have any insight into it to add to the issue (since the last relevant changes seem to be by you).

Otherwise, we can just investigate as soon as there's availability from the current sprint issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Elements: Image Group: Canvas P2 Should do soon Package: Story Editor /packages/story-editor Type: Bug Something isn't working Type: Code Quality Things that need a refactor, rewrite or just some good old developer ❤️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants