admonitions icon indicating copy to clipboard operation
admonitions copied to clipboard

🐞 Strange Behavior of Callout Type Autocompletion

Open RyzenFromFire opened this issue 9 months ago • 1 comments

Check for existing bug reports before submitting.

  • [X] I searched for existing Bug Reports and found no similar reports.

Expected Behavior

I type >[! and a dropdown list of admonition types appears. I can type more characters to search/narrow down the list of types. When I press Enter (or alternatively Tab, doesn't matter to me), the currently selected one is autocompleted and my cursor is placed at the end.

Current behaviour

I type >[! and a dropdown list of admonition types appears. I can type more characters to search as desired, but the first character I type is always kept, and then the autocompleted type is concatenated. For example, if I type >[!n and then select the note type, the result is >[!nnote] (with my cursor one space after the bracket - that part is fine).

image image

Furthermore, in this case, pressing Enter (or left-clicking) to confirm the autocompletion doesn't work in a clean vault for some reason. That is, I can't actually autocomplete.


If I only type >[! with no additional characters, then select a type, a newline is inserted. Like before, in a clean vault, pressing Enter or clicking to confirm doesn't do anything.

image image


If I type a space >[! , then select a type, the selection menu remains open, which can cause "chaining" of the part of the admonition declaration after the part already typed (ex. note]):

image image image image ...ad nauseum

Unlike the previous two cases, pressing Enter to confirm the autocompletion works in a clean vault, exhibiting the same behavior described here.

Reproduction

  1. Open any vault and file.
  2. If the Admonition plugin is not already installed, do so.
  3. Using live preview or source view mode, type >[! followed by: 1. some other character that is part of a valid admonition type, 2. nothing, or 3. a space.
  4. The admonition autocomplete selection menu appears. Select one by pressing Enter or clicking on it.
  5. Depending on what you did in Step 3, the behavior corresponding to the case described above occurs.

Which Operating Systems are you using?

  • [ ] Android
  • [ ] iPhone/iPad
  • [ ] Linux
  • [ ] macOS
  • [X] Windows

Obsidian Version Check

v1.5.12 and v1.4.16

Plugin Version

10.2.0

Confirmation

  • [X] I have disabled all other plugins and the issue still persists.

Possible solution

No response

RyzenFromFire avatar May 15 '24 00:05 RyzenFromFire