Forum Discussion
Disable Modern Comments Delete functionality
Currently it is not possible to edit the comment or disable deletion of comments.
Reference: SharePoint Online: All you need to know about Commenting in Lists
Please click Mark as Best Response if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
- MastahhFeb 16, 2021Copper Contributor
- ganeshsanapFeb 16, 2021MVP
As RobElliott said, Injecting custom JavaScript/CSS on modern pages is not recommended.
However, you can inject JS and CSS files into SharePoint Modern pages using SPFx Application Customizer.
SPFx application customizer will be loaded on all existing and newly created modern pages in SharePoint. So, you have to check if you are on correct list/library within your code and then inject the necessary code.
You can also check the current logged in user and his/her permissions and hide the disable button accordingly.
- Build your first SharePoint Framework Extension.
- Inject Custom CSS on SharePoint Modern Pages using SPFx Application Extensions.
- Step By Step Procedure To Add A JS File To All Pages In A SPFx Modern Pages Using SharePoint Framework Extension.
For more information, check my answers at:
- What is the best practice for getting JS and CSS files into a SharePoint Modern Page?
- Remove logo at top left from SharePoint online hub site?
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
- MastahhMay 17, 2021Copper ContributorThank you for the answer so as I understand sharepoint is still in beta phase, is there any info when final version of Sharepoint will be released?
- RobElliottFeb 16, 2021Silver Contributor
Mastahh with out-of-the-box SharePoint Online you can't inject javascript. Microsoft did this deliberately so sites wouldn't break when they add new features & functionality under their continuous development model. It might be do-able with SPFx but I have no knowledge of that as we can't use it at our company.
Rob
Los Gallardos
Microsoft Power Automate Community Super User