"Hidden" files are clickable and take space in navigation

Steps to reproduce

if you take any Template and hide the elements like:

	display: none !important;
	display: none !important;

the div which contains the element will be hidden which is correct but the elements are taking still place and can be clicked and opened by mistake


Expected result

  • that the marked areas in red is not there

Actual result


Obsidian version: v1.1.9
Installer version: v0.14.15
Operating system: Windows 10 Enterprise 10.0.19042

Additional information

  • I believe the issue is that the element nav-file is not possible to target and it remains to be clickable

This might be off-topic. But you should really really download the latest installer and reinstall Obsidian. In 0.15.9 a major upgrade required re-downloading. And in 1.1.9 it happened again. This might be irrelevant to your issue. But you might be experiencing other issues from not upgrading.

1 Like

Do you perhaps need to hide a parent element of the div instead?

yes that is what I also meant it is not possible to target with CSS because all files have the div with class “nav-file” so you would hide even .md files.
This issue was raised and mentioned to be fixed many versions ago

I will try to download the installer and re-install Obsidian first.

1 Like

thanks for the suggestion but it did not help. Still the same.

Does the issue still happen when using the default theme?

Given a more recent installer, like anything above 1.0.0, you get access to the :has() selector, this allows you do stuff like:

div.nav-file:has( div[data-path$='.xlsx'] ) {
  display: none !important;

Not tested, but it should work, and then you’re targetting the “correct” div, without affecting other div’s with the same class.

moved to help because this involved changing the default css.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.