Aeolun / react-diff-viewer-continued

A simple and beautiful text diff viewer component made with Diff and React.
https://aeolun.github.io/react-diff-viewer-continued/
MIT License
113 stars 34 forks source link

How to select desired text in splitview? #15

Closed LifeIsStrange closed 4 months ago

LifeIsStrange commented 1 year ago

In splitview, a user will often want either to copy all the text of the left view, or all the text of the right view. Unfortunately, contrary to e.g. Github diff, when we select text after a paragraph it begins to also select the other side of the splitview, which is undesired. For example my app needs to show an old version and a new version of a SQL query. The user wants to select chunks or all of the previous query, or of the new one, not a mixed version of both..

How to fix the selection? The html structure is mixed which seems to prevents a CSS solution for selection.

Aeolun commented 1 year ago

Yeah, right now the way the diff is displayed is with a table. If we need to split the selection, that would need to happen by making the two sides separate. The table is convenient for layout, since lines always align, but it's probably not impossible to do it with two separate div's instead.

Pangamma commented 1 year ago

I am also interested in a fix for this.

Aeolun commented 10 months ago

:tada: This issue has been resolved in version 4.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: