Remove dashes from list details pages

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.

6 Likes

Hi @artur,

This works for text - but not video. IA grey square remains, like this:

Screenshot 2022-11-29 163739

Is there a fix for video too?

Hey @ChezS,

We are having some discussions about this issue, I’ll keep you posted once having an update on this.

Will need to come up with a better solution, surely.

1 Like

Hi @ChezS - I use this custom code on the page and it removed the video placeholder.

img.video-placeholder.sw-width-full.sw-border-style-none.sw-border-width-xs.sw-border-color-000000 { display: none !important; } img.video-placeholder.sw-width-l.sw-border-style-none.sw-border-width-xs.sw-border-color-000000 { display: none !important; }

any update on this ?

Hi, this did not work. I used the same custom code. Is it still applicable code that works in the Softr environment?

Below is my custom code -

@artur