medium-editor icon indicating copy to clipboard operation
medium-editor copied to clipboard

Alignment not working as intended.

Open robertuniqid opened this issue 9 years ago • 2 comments

Description

When I try to align left / center / right the script is not working as intended, it was working perfectly before, now when I test the other day, it's not working.

Steps to reproduce

  1. Select Text
  2. Align Center
  3. The alignment doesn't happen.

Expected behavior:

To align the text

Actual behavior:

An <br/> is added.

Link to an example:

I'm not sure how to replicate this, as it's within an WordPress environment, but I can create an example link if needed.

Versions

  • medium-editor: 5.23.0 ( latest )
  • browser: Firefox 51.0.1 ( This issue is not present on Chrome or Safari )
  • OS: macOS Sierra ( Version : 10.12.3 )
  • Environment : Latest WP Version within the wp-admin
  • Faulty Commands : justifyLeft, justifyCenter, justifyRight

Worth to mention, there's 100 instances of the editor, from one single endpoint.

new MediumEditor('.the-identifeir' [ .... ] );

Things I've noticed.

Initially I tought it's the fault of my listener, but I've removed it and the same issue.

    this.primaryEditor.subscribe('editableInput', function(event, editable) {
      var textarea = jQuery(editable).next();

      textarea.val( jQuery(editable).html() ).trigger( "change" );
    });

I've checked what my listener receives, and it's the right thing ! I've tried to reset the content in the

area of the medium editor, but it didn't do the trick, I didn't even expect it to, but it was worth a shot.

robertuniqid avatar Mar 05 '17 15:03 robertuniqid

The most key detail, is that only the first line cannot be aligned, if it works perfectly for all the others, except the one at the top, just noticed this, if I don't do anything to the first line, everything after works as intended.

robertuniqid avatar Mar 06 '17 16:03 robertuniqid

I just got this same issue on Firefox too - have you found a solution?

ramykhuffash avatar Oct 11 '17 22:10 ramykhuffash