Currently list details blocks show dashes (-) when the expected content is empty. As a quick solution this code below will fix it until the team is doing proper fix.
<script>
window.addEventListener('get-record-list-details2', (e) => {
function getElementsByText(str, tag = 'p') {
return Array.prototype.slice.call(document.getElementsByTagName(tag)).filter(el => el.textContent.trim() === str.trim());
}
setTimeout(() => {
const emptyElements = getElementsByText('-');
emptyElements.forEach(element => element.closest("div.label-wrapper").style.display = 'none');
}, 100);
});
</script>
Note: list-details2
is the id of the block which can be found in the block settings panel.