I am trying to prevent text selection highlighting of a TUniLabel which is being dynamically created in code.
In the UniServerModule.CustomCSS I have the following:
.noselect {
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently
Hi,
For example:
1. CustomCSS:
*.unselectable {
-moz-user-select: -moz-none;
-khtml-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
2.
FLbl := TUniLabel.Create(Self);
FLbl.Parent := Self;
FLbl.Font.Size := 20;
FLbl.Left := 10;
FLbl.Text := 'Hello There';
FLbl.JSInterface.JSCall('addCls', ['unselectable']); //<---------
Best regards,