Skip to content
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

Context Menu Paste issue fixed. #331

Merged
merged 2 commits into from
Jan 18, 2024
Merged

Conversation

faseehahmed1
Copy link
Contributor

@faseehahmed1 faseehahmed1 commented Jan 17, 2024

Problem: When copying from an excel sheet where cell has multiple lines the context menu paste does not work.

There are 2 ways you can paste:
Keyboard: cntrl+v (OnPaste)
Context Menu: right click paste (Type: 'PASTE')

Keyboard first checks

if (item.types.includes('text/html')) {
                      const htmlTextData = await item.getType('text/html')
                      pasteData = parseTextHtmlData(await htmlTextData.text())
}

Whereas the context menu paste was first checking:

if (item.types.includes('text/plain')) {
                      const plainTextData = await item.getType('text/plain')
                      pasteData = parseTextPlainData(await plainTextData.text())
 }

With my changes 'text/html' is checked first on context menu paste just like it already is on keybaord paste.

Here is a gif showing the issue when a cell has multiple lines context menu paste does not work:

CleanShot 2024-01-17 at 10  06 20

Issue is fixed with my changes 🙂

Copy link

netlify bot commented Jan 17, 2024

Deploy Preview for react-datasheet-grid canceled.

Name Link
🔨 Latest commit 35c777c
🔍 Latest deploy log https://app.netlify.com/sites/react-datasheet-grid/deploys/65a7a721f24d960008af7cd7

@nick-keller nick-keller merged commit 783dba4 into nick-keller:master Jan 18, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants