Steps to reproduce
- In the vault, open any note in a new tab in Editing view.
- Press
Ctrl+F, then close the find bar withEsc(or the X). - Switch the same tab to Reading view (
Ctrl+E). - Press
Ctrl+F, type something and leave the find bar open. - Press
Ctrl+P(also after clicking on the note text).
Did you read and follow the Troubleshooting Guide? Yes. Reproduced in the sandbox vault (no community plugins, no snippets, restricted mode on) on installer 1.13.7 (3 out of 3 times) and again on installer 1.14.4 (2 out of 2 times).
Expected result
The command palette opens. Hotkeys keep working while the Reading view find bar is open.
Actual result
Nothing happens. No hotkey works in that tab (Ctrl+P, core and plugin hotkeys) until the Reading view find bar is closed, the tab is closed or Obsidian is restarted. Other tabs are not affected.
Control: if I open a note directly in Reading view and use Ctrl+F without step 2, Ctrl+P works normally. So closing the find bar in Editing view (step 2) is what triggers it.
Environment
SYSTEM INFO:
Obsidian version: 1.14.4
Installer version: 1.14.4
Operating system: Windows 11 Home Single Language 10.0.26300
Login status: logged in
Language: pt-BR
Catalyst license: none
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on
RECOMMENDATIONS:
none
Additional information
I’m a law student from Brazil and I use Obsidian to read and annotate the text of the laws. To make that easier, I started building my own plugin with the help of AI. I don’t know anything about programming. While using it, my plugin’s hotkey sometimes did nothing, and then I noticed that no hotkey worked in that tab, not even Ctrl+P. Restarting Obsidian fixed it. With the AI’s help, I reproduced it in the sandbox vault, with no plugins, using real key presses.
What the AI found by inspecting the code while the bug was active (I can’t judge this myself):
- The Editing view find bar sets the tab’s scope directly:
editMode.search.applyScope = function(e){ view.scope = e }. Closing it leavesview.scope === nullinstead ofview.initialScope.MarkdownView.replaceScopewould dothis.scope = e || this.initialScope. - The Reading view
showSearch()then creates its search withnew Scope(this.view.scope), so its parent isnull, andScope.handleKeynever reaches the root scope, where the hotkeys are registered. - Console check while the bug is active:
app.workspace.activeLeaf.view.previewMode.search.scope.parent === nullreturnstrue. Without step 2, the parent is the tab’s normal scope. - Possible fix: use
view.replaceScope(e)(or fall back toinitialScope) in the Editing view search’sapplyScope.
Possibly related, but different (older report, only about Ctrl+F refocusing the search box): Can't use shortcut to refocus on search box in reading mode
To be fair, this is a pretty “silly” bug: closing the find bar and opening it again makes everything work normally. Since I don’t know anything about programming, I can’t tell whether it’s worth the effort to fix. But if it’s easy, maybe it’s worth it, so it doesn’t confuse other users the way it confused me.