slate-edit-table icon indicating copy to clipboard operation
slate-edit-table copied to clipboard

Support multiple cell types

Open maxmax1992 opened this issue 8 years ago • 2 comments

I have plugin set up like this:

const tablePlugin = PluginEditTable({
  typeTable: ['table'],
  typeRow: ['table_row'],
  //<th> and <td> elements
  typeCell: ['table_cell', 'table_heading']
});

adding this parameter object for PluginEditTable like above breaks the functionality of the isSelectionInTable function, with this breaking most of the plugin functionality as it can't recognize the table. However removing that object parameter from PluginEditTable fixes it:

const tablePlugin = PluginEditTable();

This problem is encountered when I want to deserialize table with multiple cell types like

and ... so I need to define multiple typeCell types. Anyone has ideas how to fix this?

maxmax1992 avatar Jul 13 '17 07:07 maxmax1992

The plugin currently only supports a single type of cells (not an array of types). I rename this issue to be a feature request for this.

Soreine avatar Sep 20 '17 08:09 Soreine

Have you tried, as a workaround, to set custom data to your cells ?

Soreine avatar Sep 20 '17 13:09 Soreine