adazzle / react-data-grid

Feature-rich and customizable data grid React component
https://adazzle.github.io/react-data-grid/
Other
6.93k stars 2.18k forks source link

Implementation of Cell Copy/Paste Events Using Clipboard Events #3462

Open naoki-tateyama opened 7 months ago

naoki-tateyama commented 7 months ago

Hi, maintainers! This PR implements onCopy/onPaste events as Cell Clipboard Events not parts of keydown events.

Previously, copy and paste events were implemented as part of keydown events. This could be slightly confusing for developers. For example, preventGridDefault method cannot be used to prevent the default onCopy behavior. With this PR, developers can now utilize Clipboard events, allowing for development with natural APIs without the need to use navigator.clipboard.writeText.

Additionally, by separating the processes that were aggregated under keydown events into onCopy and onPaste events, it is possible to reduce the complexity of the implementation.

I believe this feature is in high demand among many developers. I hope you will consider it.

Related PRs

Related issues