Great question — answering as the UphillTech team:
Instead of adding invisible text, I'd check whether the collection actually has any filter items before showing the popup. For example: var sourceItems = filterGroup.querySelectorAll('li.facets__item'); if (sourceItems.length === 0) { popup.style.display = 'none'; return; } If the archive collection has no tags, the popup won't appear, while it will still work on your active collection. If the archive page has a unique handle or template, you could also skip the popup based on that.
Full answer by sesa: https://stackoverflow.stackexchange.com/a/79981301 (CC BY-SA 4.0).
Need it done for your business? UphillTech.