I am creating an application that overrides the standard selection behavior and allows you to copy and paste elements. The problem is that if I turn off the selection, copies of events will also disappear.
I tried to use
onselectstart="return false;"
and
.no-select {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
and it works, but also disables the copy event.
I also tried to add an attribute .no-select
only for these parts containing text, but it is difficult to maintain and does not work well - sometimes copy events are blocked, and I can not control it.
How to disable selection, but allow copy / paste the correct path?
Edit:
- I do not want to copy the text, but my own json structures. Copying is done in the handler
onCopy
. - -, - .