Omg, are you seriously claiming that you read the discussion in the issue and didn’t see this message?
This led me to believe that the Obsidian’s internal “Files: Reveal current file in navigation” command is the one that traps focus to the Files sidebar, but in such a way that the focus is brought back to it whenever “space” is hit. Similarly how you can press a button on a website by hitting space as long as it has focus. So my conclusion is that the bug seems to be with the “Files: Reveal current file in navigation” command, and not this plugin itself. Therefore, the fix should take place by the Obsidian team, not the plugin author.
There might be workarounds to resolve the issue without waiting for Obsidian to fix the issue, as Pane Relief manages to bypass focus stealing, but I didn’t have time to look into that.
My initial workaround was to hold space while typing the title, but it’s not possible on the mobile, so I resorted to locking focus using the Pane Relief plugin.
Taking a quick look at the source code for the plugin, my best guess is that the file-open
event is (for some reason, possibly a baseline bug) being fired by Obsidian when that first space
is hit.
As far as I remember from my debugging, the file-open event is not fired by hitting space
, but rather by the focus being taken away from the title bar, which is itself caused by hitting space
after a file has been previously revealed.
I’m not familiar with Obsidian plugin development, but I wonder if that handler can be updated to do a check to see if the file title input currently has focus, and if so, don’t call reveal()
?
None of the code in the plugin seems to be triggered at the time the focus is stolen from the title input. The stage is set before that by calling reveal(), and subsequently file-explorer:reveal-active-file
before that.
So to circumvent the issue, the focus should be “locked” somehow while the title input is focused. I didn’t have time so far to dig through the docs and I’m quite unfamiliar with Obsidian’s API/architecture. If anyone can point me to the right direction regarding the APIs we’d need to use, I’m happy to do that. I’m sure Pane Relief source code might help here."
If you really don’t want to see it, there’s nothing I can do. But the developer “lightheaded,” who commented on the issue, has clearly and explicitly described the problem. He also mentioned that the issue is caused by Obsidian. So what’s the point of requesting a “bug report template” after this?