-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature]: Enable/disable options RichTextEditor #11566
Comments
@lublak thanks for raising this. While RTE is for editing rich texts, I can understand why you would like to control the behavior. @Tooluloope can you help me understand if introducing an underlying logic for disabling these features is possible? We should at-least expose a way to disable media for sure |
the best way to go about this would be to load most of these plugins which we have done here #10633 and then use a multi-select in the property pane to allow the app developer to include or exclude any plugin. |
I have the same idea for now, adding this to needs PRD bucket for me to suggest the design change and move. |
It can also be used the toolbar options: |
Having the ability to modify the toolbar options in the RTE would be helpful for my team. We use rich text fields in an info gathering form for reporting issues to our team. Once the form is submitted we use API calls to send the information to other systems like Jira that have their own formatting/markup. We either have to account for all the possibilities and adjust the formatting or accept there will be some problems in message formatting in the receiving system. For example, Insert Images/ Insert Media are not needed for our use case and add complexity if we were to try and support embedded images. It would also be helpful to be able to add a code block formatting option. This comment box on github has a Being able to control limited input options helps simplify other development efforts for processing the inputted data. I can probably implement a custom widget importing a library like quill.js, but that adds another complication to track and contend with future changes. It would be ideal to be able to configure the built in RTE. |
ticket created in Jira-https://zemoso.atlassian.net/browse/TNOSB-472 |
Hi @Nikhil-Nandagopal Im picking up this issue.I will update the approach once i complete exploring code. |
@SaiCharanChetpelly31 the solution is to have a simple multi-select property in the rich text editor |
I’ve added a multi-select property in the property pane of the RTE widget. While I can retrieve the selected options from the multi-select field, I’m having trouble enabling or disabling toolbar options in the RTE widget based on the user’s selections. I’ve reviewed the TinyMCE documentation but couldn’t find a solution. Could you please tag someone familiar with the RTE widget or TinyMCE documentation who might be able to help me resolve this blocker? Looking forward to your response. |
I reviewed the documentation, but I couldn't find any information on enabling or disabling specific toolbar options. I created a multi-select property in the property pane for user selection, which includes all toolbar options like bold, italic, link, image, media, etc. The selected disablePluginTypes are passed as a prop to the RTE component, where I'm filtering the toolbarConfig based on these disabled plugin types. The toolbar is then set according to the following conditions: If props.isToolbarHidden is true, the toolbar is set to false. doc-fafs-jqq.2024-08-12.09_50.GMT+5_30.mp4 |
@SaiCharanChetpelly31 can you ensure the multi-select has a checkbox and does not highlight the entire option but just checks the box? |
@Nikhil-Nandagopal, for consistency, I have followed the approach used in the FilePickerWidget. Should I make the MultiSelect component with checkboxes for each option and avoid highlighting the entire option, or should I keep it the same as the FilePickerWidget? |
@SaiCharanChetpelly31 ok for consistency it makes sense |
Is there an existing issue for this?
Summary
It would be handy to be able to deactivate different things in the Rich Text Editor.
Why should this be worked on?
Since you can't currently set what things you want to allow in the editor.
For example, I do not want to have images media etc.. Only text, bullet lists and links.
The text was updated successfully, but these errors were encountered: