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

Figure alignment is broken #106

Open
dsuppiger opened this issue Apr 3, 2021 · 1 comment
Open

Figure alignment is broken #106

dsuppiger opened this issue Apr 3, 2021 · 1 comment

Comments

@dsuppiger
Copy link

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)

@Jako
Copy link
Collaborator

Jako commented Apr 6, 2021

This option was introduced with TinyMCE 4.3 and since the float was never applied to a surrounding figure element, I am quite sure that it does not worked in that version too. So the code of the modximage plugin has to be changed to apply to the figure element, when it exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants