Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,16 @@ export default class EditorjsList {
this.listStyle = 'unordered';
}

this.list!.onPaste(event);
// update the data first with the formatted list data from the paste handler
this.data = this.list!.pasteHandler(event.detail.data);

// then make sure that the instance is re-instantiated to hold the new data with the new styles
this.changeTabulatorByStyle();

// create a replace the new rendered list element with the current one.
const newListElement = this.list!.render();
this.listElement?.replaceWith(newListElement);
this.listElement = newListElement;
}

/**
Expand Down