BoldDesk®Customer service software with ticketing, live chat & omnichannel support, starting at $99/mo for unlimited agents. Try for free!
Hi,
I need to implement a toolbar using Syncfusion components. However, I would like to know how to customize the toolbar to remove the image icons while keeping the text or other elements intact. I noticed that if I remove the image from the toolbar configuration, it disables the image upload functionality, which is not the desired outcome.
Hi Viji Palanisamy,
We have reviewed your query and would like to inform you that simply removing the image item from the toolbar will not disable the image upload functionality. If you're encountering this issue, please ensure that the image module is correctly injected into the Rich Text Editor to maintain image-related functionality. Without injecting the image module, the image upload and related features will not work as expected. Please let us know if you need any further clarification or assistance.
Regards,
Yaswin Vikhaash
Hi Yaswin Vikhaash,
Thank you for your response regarding the image upload functionality in the Rich Text Editor. I have updated my code and attached the current version for your review.
I would like to clarify a few points:
toolbarSettings
, which has achieved my requirement.Looking forward to your guidance.
Best regards,
Viji Palanisamy
Hi Viji Palanisamy,
We have thoroughly reviewed your query and found a solution. To achieve complete prevention of pasting specific content, we recommend utilizing the Paste Cleanup feature. Within this feature, you can use the deniedTags attribute to restrict certain tags from being pasted. Additionally, we have binded the actionBegin event to prevent the drag-and-drop functionality, ensuring comprehensive control over the paste action.
By combining these approaches, you can effectively prevent images from being pasted. Please find the attached code and sample for your reference.
Sample: https://stackblitz.com/edit/react-qcefeq?file=index.js,index.html
Code
function onActionBegin(args) {
if (args.type === 'drop' || args.type === 'dragstart') {
args.cancel = true;
}
}
let pasteCleanupSettings = {
deniedTags: ['img'],
};
<RichTextEditorComponent
actionBegin={onActionBegin.bind(this)}
pasteCleanupSettings={pasteCleanupSettings}>
Regards,
Yaswin Vikhaash
Thanks. It works as expected.
You're welcome! Please get back to us if you need any further assistance.
Regards,
Yaswin Vikhaash