react-diff-view icon indicating copy to clipboard operation
react-diff-view copied to clipboard

This can simply solve the copy & paste issue, but this will cause an extreme performance dropdown since it involves multiple table layouts, also it could probably incompatible with customizations such as `widgets`, `renderGutter` and `Decoration`, I mostly will not use this fix.

Open lunalusy opened this issue 6 years ago • 6 comments

This can simply solve the copy & paste issue, but this will cause an extreme performance dropdown since it involves multiple table layouts, also it could probably incompatible with customizations such as widgets, renderGutter and Decoration, I mostly will not use this fix.

Originally posted by @otakustay in https://github.com/otakustay/react-diff-view/issues/62#issuecomment-520705178

can add classname to distinguish both side.. listen which side mousedown ,other side can stop user-select or can support to distinguish side?

lunalusy avatar Aug 13 '20 14:08 lunalusy

We're already doing "classnames to distinguish both side" and "listen which side mousedown" and "add user-select: none to the other side", the problem is user-select: none does not prevent text from being copied.

otakustay avatar Aug 13 '20 14:08 otakustay

We're already doing "classnames to distinguish both side" and "listen which side mousedown" and "add user-select: none to the other side", the problem is user-select: none does not prevent text from being copied.

why is that?May I know when you can support to distinguish both side ?I'm in a hurry....please...thank you

lunalusy avatar Aug 14 '20 03:08 lunalusy

This is already supported in events, by passing custom events to diff component, event callback receives a context object as its argument, this object is {side, change} in which side is either old or new

otakustay avatar Aug 14 '20 05:08 otakustay

side emmm..I hope it can be distinguished from label..when mousedown i can known which side

lunalusy avatar Aug 14 '20 06:08 lunalusy

onMouseDown in codeEvents and gutterEvents props supports the context object with side property in it, you can try it

otakustay avatar Aug 14 '20 06:08 otakustay

onMouseDown in codeEvents and gutterEvents props supports the context object with side property in it, you can try it

my problem is resolved..thank you very much

lunalusy avatar Aug 14 '20 07:08 lunalusy