I removed the delete button with the below JS script; however, is there a way to do the same with the Canvas App? Thanks
// Remove DELETE button Icon and from the MENU
document.addEventListener('DOMContentLoaded', function() {
function hideDeleteElements() {
var deleteButton = document.querySelector('[aria-label="Delete"]');
if (deleteButton) {
deleteButton.style.display = 'none';
}
var menuItems = document.querySelectorAll('[role="menuitem"]');
menuItems.forEach(function(item) {
var itemLabel = item.querySelector('.css-oqi6mv-menuItem__label');
if (itemLabel && itemLabel.textContent.trim() === 'Delete') {
item.style.display = 'none';
}
});
}
hideDeleteElements();
var observer = new MutationObserver(function(mutationsList, observer) {
for (var mutation of mutationsList) {
if (mutation.type === 'childList' && mutation.addedNodes.length > 0) {
hideDeleteElements();
}
}
});
observer.observe(document.body, { childList: true, subtree: true });
});
// END script to remove DELETE button Icon and from the MENU
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.