Image width changes not persisted to model after initial save

Created on 18 December 2023, 6 months ago
Updated 3 February 2024, 5 months ago

Problem/Motivation

Resizing an image using the resize drag handles only updates the CKEditor5 Model values (and the HTML source) when first adding the image to a node. When performing subsequent edits to the node using the resize handles to change the width only changes the View but does not reflect into the HTML source nor get persisted to the Model, leaving the image width unchanged.

Steps to reproduce

1. Add a media library image to a content area.
2. Set the size using the resize drag handles (in this example 500px width).
3. Save the node.
4. Edit the node.
5. Use the resize drag handles to change the width of the image (eg. now 680px width).
6. Save the node.
7. Note that the image remains at the previous width (500px).
8. Edit the node.
9. Note that the image is again 500px in the editor.
10. View HTML source
11. Note that the data-media-width value is 500px (not 680px).

Proposed resolution

Something about the resizemediacommand execution is changing the View width values but not modifying the underlying Model values when the command is executed. You can see this by installing the ckeditor5_dev contrib module and using the dev tools to inspect the Model and View while performing the steps above.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Closed: duplicate

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024