denvolok / obsidian-file-explorer-navigation

Obsidian plugin to enable keyboard based navigation and interaction in the file explorer.
MIT License
0 stars 0 forks source link

After FileExplorer focus selected item sometimes missing border #1

Closed denvolok closed 4 months ago

denvolok commented 5 months ago

It's a standard(expected) behavior of Obsidian, but would be nice to fix it.

Use the following function to select item manually:

    this.registerEvent(
      this.app.workspace.on("active-leaf-change", (leaf) => {
        if (leaf?.view.getViewType() === "file-explorer") {
          const fileExplorer = this.app.workspace.activeLeaf?.view as View;
          // @ts-ignore
          fileExplorer.tree.setFocusedItem(item, 1);
        }
      }),
    );

Scenario: open note -> close note -> focus file explorer

denvolok commented 4 months ago

won't fix. Can reproduce only if closed note was last focused in file explorer, and there seems no reliable soluton