Open TeddyBonkerz opened 3 years ago
You can set the user-select
CSS property to none
on those elements. Ideally this would be built in to this project, but until that happens you can do the following in your component that uses td-ngx-text-diff
.
Configure the component to allow CSS from the parent to apply to child components with encapsulation: ViewEncapsulation.None
, e.g.:
@Component({
selector: 'app-foobar',
templateUrl: './foobar.component.html',
styleUrls: ['./foobar.component.css'],
encapsulation: ViewEncapsulation.None
})
Add the styles to foobar.component.css
:
.td-wrapper .line-number-col {
user-select: none;
}
.td-wrapper .line-number-col-left {
user-select: none;
}
.td-wrapper .prefix-col {
user-select: none;
}
Note that since we're taking the unusual step of allowing CSS from the parent to affect child components were taking extra care to target the elements of interest. If there's zero chance of your component using, e.g.: class="prefix-col"
outside of the diff component then you can omit the leading .td-wrapper
selector.
Is there anyway to prevent the '+' and line number from being copied ?![image](https://user-images.githubusercontent.com/33665345/109703823-eb9f5a80-7b63-11eb-996e-e7f78a1fd71e.png)