prosemirror-utils icon indicating copy to clipboard operation
prosemirror-utils copied to clipboard

Add new method to copy rows in a table with configurable options

Open RatoX opened this issue 5 years ago • 0 comments

Deprecated the cloneRowAt and added a configurable method to copy a row in table copyRow.

The copyRow will make this behavior possible:

Screen Recording 2019-08-05 at 11 13 am

with this code:

copyRow(5, 4, {
      expandRowspanFromClonedRow: false,
      keepColspan: true,
      getNewCell(cell) {
        // We can do anything here, even add a new content if we want to
        return cell.type.createAndFill({ background: cell.attrs.background });
      },
    })(state.tr)

cloneRowAt is being deprecated because is an inflexible function with a strong opinative logic, by default with same table we have only this behavior: Screen Recording 2019-08-05 at 11 19 am

RatoX avatar Aug 04 '19 01:08 RatoX