Opened 7 years ago

Closed 6 years ago

#9478 closed Bug (fixed)

CKE 4.x - Undefined table width gets reset to default

Reported by: Joel Owned by:
Priority: Normal Milestone:
Component: UI : Dialogs Version: 4.0
Keywords: Cc:

Description (last modified by Jakub Ś)

To reproduce:

  1. Clear editor contents with CRTL+A Backspace
  2. Insert default table
  3. Open table properties dialog, clear width value and click OK
  4. Open table properties one more time.

Result: Default table width 500px is present in width field and once you click OK table gets default width.

Reproducible in CKEditor 4 in all browsers. Works fine in CKEditor 3.6.5

The comment:7 is about separate issue reproducible in both CKE 3.x and 4.x. It has its own ticket #9560.

Change History (9)

comment:2 Changed 7 years ago by Joel

Apparently this requires a specific configuration to work. I could not reproduce in demo, but I was able to reproduce (IE9 & Chrome) in the V4 demo at http://nightly-v4.ckeditor.com/3694/samples/fullpage.html

  1. Empty the entire CKE contents (ctrl-a, delete)
  2. Add a table without changing the default values (3 rows, 2 cols, 500 width, etc)
  3. Enter some foobar data into the table
  4. Rightclick table and select properties
  5. Notice that the width is at 500px - remvoe that value, so that the width input field doesn't contain anything
  6. Click ok
  7. Notice that the table got smaller to fit your foobar data as expected.
  8. Rightclick the table and select properties again
  9. Notice that the width field contains "500". Change for example the border width to 10. without touching the width and click ok
  10. Notice that the table width changed to 500px even though you didn't change it

Another way on the same page

  1. Clear the entire contents of the editor
  2. Add a table but this time put for example 5 rows, 5 cols, 5 border and clear the width value so that the width input is completely empty and click ok
  3. Add some Foobar data
  4. Rightclick the table, select properties
  5. Notice that the width field says "500". Without touching the width field, change the border to 10 and click ok
  6. Notice that the width of the table changed without you changing it

comment:4 Changed 7 years ago by Jakub Ś

Component: GeneralUI : Dialogs
Description: modified (diff)
Status: newconfirmed
Summary: Undefined table width gets reset to default if changing other settings.Undefined table width gets reset to default
Version: 3.6.44.0 (GitHub - master)

comment:5 Changed 7 years ago by Jakub Ś

Description: modified (diff)

comment:6 Changed 7 years ago by Joel

This bug depends quite a bit on the configuration. I was able to reproduce in 3.6.2 in jsfiddle, see http://jsfiddle.net/gz9b4/1/

If you remove the following conditional and everything in it, the bug does not appear. If you keep it, the bug appears.

if ( dialogName == 'tableProperties' ){...}

comment:7 Changed 7 years ago by Jakub Ś

Description: modified (diff)

@req - without your code modifying the table plugin bug can only be reprodyuced in v4. With this code bug can be reproduced in v4 but also in v3 from CKE 3.6.1 rev. [6979]. I have reported it here #9560 as this is different issue.

	CKEDITOR.on( 'dialogDefinition', function( ev )
            {
                var dialogName = ev.data.name;
                var dialogDefinition = ev.data.definition;

                // Set default table width during creation.
                if(dialogName == 'table')
                {
                    var infoTab = dialogDefinition.getContents( 'info' );
                    txtWidth = infoTab.get( 'txtWidth' );
                    txtWidth['default'] = '100%';
                }

                if ( dialogName == 'tableProperties' )
                {
                    var infoTab = dialogDefinition.getContents( 'info' );

                    var tab = dialogDefinition.getContents( 'advanced' );
                    tab.remove ('advLangDir');
                    tab.remove ('advStyles');
                    tab.remove ('advCSSClasses');
                }
            });

window.x  = CKEDITOR.editor.replace('editor1', {
    removePlugins : 'button,div,filebrowser,flash,format,forms,horizontalrule,indent,justify,liststyle,pagebreak,showborders,stylescombo,templates',
        toolbar :
            [
                ['Source', 'Table']
            ],
});

comment:8 Changed 7 years ago by Joel

Thanks for creating this as separate, i didn't understand it needed one :)

Last edited 7 years ago by Joel (previous) (diff)

comment:9 Changed 7 years ago by Jakub Ś

Description: modified (diff)
Summary: Undefined table width gets reset to defaultCKE 4.x - Undefined table width gets reset to default

comment:10 Changed 7 years ago by Jakub Ś

This particular TC can only be reproduced in v4 but let's say it is connected with this issue #9560 which can be reproduced in both v3 and v4.

comment:11 Changed 6 years ago by Piotrek Koszuliński

Resolution: fixed
Status: confirmedclosed

Fixed with #9875.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy