Skip to content

How can I change getItems in useClipboard based on whether the user is copying or cutting? #7673

Answered by reidbarber
lilbropeep asked this question in Q&A
Discussion options

You must be logged in to vote

We could probably support this by doing something like:

  getItems?: (details: {type: 'cut' | 'copy'}) => DragItem[],

and passing the type for each when getItems is called.

I think any other workaround would be hacky and involve listening for beforecut/beforecopy manually on the element and communicating that up.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@lilbropeep
Comment options

@reidbarber
Comment options

Answer selected by lilbropeep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants