Fix for the phantom hover highlight bug in Obsidian when scrolling with the mouse wheel.
After scrolling with the mouse wheel, the hover state gets stuck on navigation elements and does not disappear — a phantom highlight remains. Reproduces on any theme.
The cause is a long-standing Chromium bug (reported in 2014). When scrolling with the mouse wheel, the browser does not fire the mouseleave event because the cursor did not physically move, so the hover state just freezes. Since Obsidian is built on Electron (Chromium), the bug is present here as well.
- Open the file explorer sidebar
- Hover over any file — it highlights
- Scroll with the mouse wheel without moving the cursor
- The hover highlight stays stuck on the element
transform: translateZ(0) forces GPU compositing layer recreation and clears the stuck hover state. Side effect — the keyboard icon in the hotkey search field shifts down due to a transform conflict, fixed with a separate rule.
- Download
fix-hover.css - Place the file in the
.obsidian/snippetsfolder inside your vault - Open Obsidian, go to
Settings→Appearance→CSS snippets - Enable
fix-hover
Works with any theme. Tested on many themes: Minimal, Primary, Things, and others.
If you notice any broken elements after installing — open an Issue.