-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Handling of dragging document list items. #15030
Handling of dragging document list items. #15030
Conversation
// See https://github.com/ckeditor/ckeditor5/issues/11608, https://github.com/ckeditor/ckeditor5/issues/14969 | ||
this.listenTo<ViewDocumentClipboardOutputEvent>( viewDoc, 'clipboardOutput', ( evt, data ) => { | ||
if ( data.method != 'dragstart' ) { | ||
const selection = model.document.selection; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is safe, in the previous implementation the provided selection was used and it could be different than the current document selection. Maybe we could check the content
instead?
if ( isSingleListItemSelected ) { | ||
model.change( writer => removeListAttributes( Array.from( evt.return!.getChildren() as any ), writer ) ); | ||
if ( isSingleListItemSelected ) { | ||
const content = this.editor.data.toModel( data.content ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not alter the clipboard content. As talked f2f let's introduce the outputTransformation
event.
…d-dropping-document-lists
…d-dropping-document-lists # Conflicts: # packages/ckeditor5-clipboard/src/dragdropexperimental.ts
Suggested merge commit message (convention)
Fix (list): Dragged selected whole list item should be still a list item after drop. Closes #14969 .
Additional information
For example – encountered issues, assumptions you had to make, other affected tickets, etc.