I have been trying to make some text within an input of my HTML unselectable in angular. I have refered to previous questions like make html text unselectable
The text currently is a code that I don't want my users to copy it before I allow it.
using this CSS works with most html elements, but not with my input.
I have tried with user-select none
Any ideas?
Thanks
.digital-code {
-webkit-touch-callout: none !important;
-webkit-user-select: none !important;
-khtml-user-select: none !important;
-moz-user-select: none !important;
-ms-user-select: none !important;
user-select: none !important;
}
<div fxLayout="row">
<div fxLayout="column" fxFill>
<mat-form-field appearance="fill">
<mat-label>{{ digitalSealCodeTitle }}</mat-label>
<input [readonly]="true" #sealCode matInput [value]="digitalSealCode" />
<mat-icon matSuffix (click)="copyValue(sealCode)" matTooltip="Copy">file_copy</mat-icon>
</mat-form-field>
</div>
</div>