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

Cell not copied if a div with contentEditable has some selected text #3683

Open
adityatoshniwal opened this issue Jan 3, 2025 · 0 comments
Labels

Comments

@adityatoshniwal
Copy link

Describe the bug

When a div with contenteditable has some text and the text is selected, then cell select and copy doesn't work. It copies text from div.

To Reproduce

  1. Select some text from a content editable div
  2. Select a cell from the grid
  3. Press Cmd/Ctrl + C.
  4. The cell is not copied.

Link to code example:
I'm not able to create a codesandbox unfortunately because it is not allowing install from git commit.

Environment

  • react-data-grid version: latest source code.
  • react/react-dom version: 18

Additional context

Root cause of the problem looks to be -

if (window.getSelection()?.isCollapsed === false) return;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant