editor-js / editor-js/table

Pasting multiple lines/blocks into tables

Open
#116 1 comment 8 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
146
Forks
162
Avg merge
5m
Merged PRs (30d)
1

Description

I'm going to call this a feature request, but some of our users have described the current table paste formatting as a bug.

**Current Handling of Pasting Into Tables:**
Right now if the user pastes multiple lines of text into a table cell, the content gets dropped underneath the entire table:
![table-paste-multiple-lines](https://user-images.githubusercontent.com/918780/210629391-a0a2227d-1fad-4e10-ad48-28cf8e08eda1.gif)

(This is accurate as of EditorJS 2.26.4 and Table 2.2)

Ideally we would change how this is handled in one of two ways:

**1. Inline-Table Style Paste**
The current Notion and Google Docs handling would be if those line breaks were kept and the text was pasted into a single cell. This is probably ideal since it matches what users would expect from similar editors:

![google-docs-multiple line paste](https://user-images.githubusercontent.com/918780/210629805-c7bd1b07-c084-42f1-938c-123c204317e1.gif)
_Google Docs example_

![notion-table-paste](https://user-images.githubusercontent.com/918780/210630219-7ab1a7a7-5ddc-4ec0-9436-b27d2dff9341.gif)
_Notion example_

**2. Spreadsheet Style Paste**
The alternative would be the spreadsheet style paste, where each line break would trigger a paste into a new row (and create the new row if needed). This is similar to how Google Sheets or Excel would handle the paste:

![google-sheets-paste](https://user-images.githubusercontent.com/918780/210629834-34520fa1-a5cc-403a-8997-8a73f85d62ef.gif)

I think the benefit to this approach is that users can still use "Shift + Paste" to keep the content pasted into a single cell if they want to, so they have a greater range of results depending on how they want to paste the content into the cells.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.