-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Active pane loses focus when opening a file in Obsidian 0.15.3 #11
Comments
The issue is that in 0.15 the "reveal active file" command puts focus on the explorer pane. In order to not do that, the plugin would need to save the active leaf and restore it afterwards, or else trigger the reveal using another method that does not specifically open and activate the file explorer pane. This problem doesn't actually have anything to do with Pane Relief: you can reproduce it in the sandbox vault on 0.15.3 with this installed as the only plugin. (@Randy-Astle, you might want to edit the title to reflect this, perhaps something like "active pane loses focus when opening a file in Obsidian 0.15.3", as that is what is causing your problem, and is also a problem for the plugin in general, as it requires people hit Escape after opening every file in order to work with it). |
Fix this issue with #13. I have attached the compiled plugin. Would you mind to test whether this meet your requirements? |
I have the same focus issue with this plug that manifests in 2 ways:
Here's hoping it can be fixed as this is one of the plugin I really love since I usually have several files open at once with a big tree. |
For anyone who needs an immediate solution for this, the Pane Relief plugin now includes a "Focus Lock" feature that prevents sidebar panes from stealing focus from the main panes. Basically, it makes Obsidian act like it used to for this plugin and many others, but the feature can be turned on and off with the mouse (click the lock in the status bar) or keyboard if you need to temporarily make the sidebar focusable, e.g. to edit a note in the sidebar. The toggle remembers its state across restarts, so you don't have to remember to switch it on each time. Edit: Whoops, I spoke too soon. Pane Relief's focus lock prevents the file explorer pane from becoming active, but it doesn't stop it from stealing focus, which remains a problem. Sorry for getting anyone's hopes up! |
Update: Pane Relief 0.2.5 now prevents the file explorer pane from stealing focus when triggered by the Reveal Active File plugin or by the keyboard command, when focus lock is on. So you can use it as a fix for this issue now. |
Yet another update: Pane Relief 0.2.7's focus lock now keeps the file explorer from stealing focus when you're in a secondary/popout window as well, so you don't have to choose between using the reveal-active-file plugin, and being able to use secondary windows. |
with obsidian 1.1.16 and automatically reveal active file 1.0.2 i have the problem of losing focus to the side pane (directory tree) if i work with multiple windows or split panes. is this the same issue as described in this issue or should i open a new issue? i will give pane relief a try, hopefully the lock focus setting help edit: |
The issue was very visible when navigating through tabs with Ctrl+PageUp/PageDown repeatedly, as it would suddenly focus the Files hierarchy and start navigating across the left side panel: Files > Search > Bookmarks instead. I confirm that installing plugin Pane Relief and using command "Pane Relief: Cycle to previous/next tab in this window" will work by ignoring side bar focus (Obsidian 1.5.3). Make sure to remove binding Ctrl+PageUp/PageDown to native commands "Go to previous/next tab" to avoid conflicts. EDIT: I still found a limitation for general use: despite focus being kept on active file content in appearance, Obsidian will still think that we are not in file edit mode and as a result, will not display commands for that scope when using Ctrl+P to open the command palette. Repro:
This becomes an issue when chaining other navigation commands such as plugin Navigate Cursor History's own commands: Navigate Cursor History: Go back/forward, as they will stop working after the file was highlighted. So while installing Pane Relief fixes tab navigation, other forms of navigation won't be fixed as each plugin would require that "ignore sidebar focus" feature which demands more work from every other plugin developer. So maybe the PR in work #13 is our best bet at the moment. It may also be fixed on Obsidian API side by providing us a variant of |
For the people who are using Pane Relief, please note that in order to prevent the navigation issue, you have to turn on Focus Lock. That's the little padlock icon in the status bar: if it shows unlocked, click it to lock it. Once locked, you'll be able to navigate just fine without any of the problem you're reporting. |
Obsidian version: 0.15.3
Pane Relief version: 0.1.8
Automatically Reveal Active File version: 1.0.2
When both Pane Relief and Automatically Reveal Active File are installed, the Pane Relief commands to move between editor panes doesn't work correctly. If I have 3+ editor panes, end up toggling between just two panes - and it looks like the left toolbar (specifically file explorer) gets the focus in the process.
As I understand it, there have been some significant changes in Obsidian 0.15.x with how panes are handled. Perhaps your extension needs to be updated.
The text was updated successfully, but these errors were encountered: