Invoking plugin modal URI multiple times creates multiple modals

Invoking plugin modal URI multiple times creates multiple modals

Important Messages, Links, and Solutions

Any temporary workarounds, solutions, or important information for related scenarios will be listed here for easy access by future readers.

Bug Report

Steps to reproduce

  1. Open a vault. (For this example i have used the Sandbox vault, but initially encountered the behaviour in one of my personal vaults.)
  2. By some method (e.g. link target, shell command, or some other method), invoke Obsidian’s plugin search URI, such as obsidian://show-plugin?id=%20 .
    • This example merely searches for a single regular space character ` ` which matches pretty much any existing plugin as if there were an empty input field.
    • The method i am using for the demonstration below is an AutoHotKey script. i have also tested via shell commands.
  3. Via the same or another method, invoke another plugin search URI.

Did you follow the troubleshooting guide? [Y/N]

Yes.

Expected result

The existing modal will be re-used. To wit, it will be focused in the activated Obsidian window as when invoking the URI from any other context. The input field will be focused, and filled with the supplied id argument as when invoking the URI from any other context.

Actual result

A new, second modal is created, and each separate modal must be closed. When using Obsidian’s default theme, this has a side effect of applying multiple .modal-bg backgrounds that continually darken the backdrop.

Environment

SYSTEM INFO:
Obsidian version: v1.4.5
Installer version: v1.3.5
Operating system: Windows 11 Home 22621.2134
Login status: logged in
Catalyst license: supporter
Insider build toggle: on
Live preview: on
Legacy editor: off
Base theme: dark
Community theme: none
Snippets enabled: 0
Restricted mode: off
Plugins installed: 0
Plugins enabled: 0

RECOMMENDATIONS:
none


Additional information

Attachments

  1. A GIF file depicting three invocations of the plugin search URI in sequence, followed by the closing of the produced modals with three separate presses of the ESC key.
    • obsidian plugin modal stacking 1