I have found a perfection for my requirements
- A dropdown of selection insert none-editable peace of text
- The text should not be change
- The text should be style able
But there is a problem, when select the uneditable span when stand alone in a line. It cannot be styled. I think it's because of the contenteditable dissmiss with user-selection:none dismiss any style change.
Here is thee related question. You can scroll down at the end to find the solution.
Custom dropdownlist in toolbar of Kendo React Editor in KendoReact | Telerik Forums
We are currently investigating the issue with the span selection and not being able to style it, however we will need more time to investigate for a possible solution and I will get back to you once I have more information.
Regards,
Filip
I went through the entire thread, however, can you please share more information on your scenario in order to provide a more accurate solution? Does the inserted text that must not be editable have to be styled by default or do you need to be styled after the user performs some action?
If the requirement is to have it styled by default this can be achieved by setting the style directly in the toDom function:
toDOM: () => [ 'span', { contenteditable: false, class: 'uneditable', style: 'user-select: none; opacity: 0.5; color: red', }, 0, ], };
Filip