Bug: Image element src not in sync when replaced with other media #10192
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 ❤️
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: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
The text was updated successfully, but these errors were encountered: