Forum Discussion
Disable Modern Comments Delete functionality
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?
- RobElliottMay 17, 2021Silver Contributor
Mastahh SharePoint and the other Office 365 aps are under constant development. There will never be a "final" version which you would have got with packaged software, it's always developing.
Rob
Los Gallardos
Intranet, SharePoint, Website and Power Platform Manager (and classic 1967 Morris Traveller driver)