ckeditor / ckeditor5

Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
https://ckeditor.com/ckeditor-5
Other
9.54k stars 3.7k forks source link

t.getStyle is not a function when dragging a list #12723

Open dpapala opened 2 years ago

dpapala commented 2 years ago

📝 Provide detailed reproduction steps (if any)

  1. The ClassicEditor is loaded
  2. I drag and drop a list in the editor (see screenshot) image

❌ Actual result

The console error image

This the function that is called getAttributeOnUpcast( listParent ) { return listParent.getStyle( 'list-style-type' ) || DEFAULT_LIST_TYPE; } in listpropertiesediting.js

This error comes periodically not every time that I drag and drop the same list.

📃 Other details


If you'd like to see this fixed sooner, add a 👍 reaction to this post.

mabryl commented 2 years ago

Hi dpapala,

Thanks for bringing this issue to our attention. I tried reproducing it on my end but wasn't able to do it. Could you provide us with more detailed steps on how to recreate the issue?

I know that you mentioned that the error appears irregularly but maybe you noticed some pattern when it occurs? Is it just this one particular list that is problematic? And if so, could you paste it in this conversation retaining its formatting?

And could you tell us what build of our editor you're using? Is it a custom version built from source or maybe it's one of our predefined builds?

dpapala commented 2 years ago

@mabryl It is a custom build. I try to drag a simple unordered list. Herre is the html code: `

mabryl commented 1 year ago

Resurrecting this thread because thanks to a report from one of our customers I found a way to more consistently reproduce this issue.

Firstly, the listPropertiesEditing plugin has to be included. documentListPropertiesEditing does not produce this issue. Then, try setting this HTML as the editor's data - <li>test</li>.

It looks like the editor doesn't like the fact that the <li> is not wrapped in an <ul> or <ol>. When you include just the opening tag, e.g. like so - <ul><li>test</li> - the issue isn't reproducible.

Not exactly sure how it's related to the dragging issue that @dpapala initially reported but it's possible that somehow the <ul> or <ol> tags get dropped when dragging the list and this prompts the issue to appear.

Witoso commented 1 year ago

Thanks, @mabryl! Most likely, this issue won't be picked up, as we have #14632 in the pipeline that should finish soon. I highly recommend switching to the Document list, as this will be our main list implementation.