Erroneous handling of leading space character in Quick Switcher

Steps to reproduce

Two related scenarios for this bug report:

First: Error being reported in the dev console:

  1. Open the developer console
  2. Open the quick switcher
  3. Press spacebar to input a single space character into the quick switcher

Expected result

No errors reported in the dev console

Actual result

The error Uncaught TypeError: Cannot read property '0' of undefined will be printed in the dev console. The error will be printed for each additional space character inserted.

Second: incorrect suggestions returned from quick switcher

  1. Open the quick switcher
  2. Input a single space character, followed by a single letter character. For example t to get suggestions for filenames that start with the letter β€œt”
  3. Once the suggestions for files beginning with the single character (β€œt”) are displayed, delete the single letter (β€œt”), but leave the space character

Expected result

Expected the suggestions for filenames that begin with β€œt” to have been cleared.

Actual result

The suggestions are not cleared after deleting the β€œt”. Suggestions are only cleared after removing both the β€œt” and the space characters.

In the screenshot below, notice that all the β€œt” letters are highlighted in each suggestion, but the input box only contains a single space (after deleting the t)


  • Operating system: MacOS
  • Obsidian version: 8.8

Additional information

Note: This also happens in LinkSuggestion widget

No Custom plugins, nor CSS

Thanks for the bug report. I can confirm it’s an issue still in 0.8.11, but it looks fixed in 0.8.12.

1 Like

Postponed to 0.8.13