Skip to content

Figure alignment is broken #106

Open
@dsuppiger

Description

@dsuppiger

Bug report

Summary

Alignment (left/right/center) doesn't work for images with captions (figure elements).

Step to reproduce

  1. Write a few paragraphs of text.
  2. Insert an image between the text and check the box to add a caption.
  3. Try switching left/right alignment (it works so far and the image floats to the left or right of the text).
  4. Switch to source mode and click save to get back to WYSIWYG mode (other actions like saving the page and reloading has the same effect).
  5. Re-select the figure resp. the figure caption and try again to switch left/right alignment a few times.

Observed behavior

Switching alignment has no effect. The image stays where it is and on top the element gets stuck with the CSS classes for both left and right alignment.

Simple images (img elements not inside a figure) work just fine.

Expected behavior

If I choose left alignment, the image floats to the left of the text. If I choose right alignment the image floats to the right of the text.

Environment

MODX version: 2.8.1-pl
Plugin version: 2.0.0-pl (version 1.3.4-pl had the same issue. Other versions I don't know.)
Browser: Chrome version 89.0.4389.90 (Official Build) (x86_64)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions