Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin automatically selects first item from library #15

Closed
atomashevic opened this issue Dec 18, 2020 · 12 comments
Closed

Plugin automatically selects first item from library #15

atomashevic opened this issue Dec 18, 2020 · 12 comments
Labels
bug Something isn't working

Comments

@atomashevic
Copy link

Reference selection/picker menu does not appear after I either run "Insert citation" or "Open literature note" command.

It automatically chooses the first Zotero item in my JSON file and inserts link or open new literature note.

OS: Ubuntu 20.04
Obsidian: v0.9.22 (deb installer)

Previously (and in previous vault) I used snap version of Obsidian and Citation plugin and selection menu did appear, but nothing happened afterwards. Then I removed the snap version, installed deb and created a new vault.

@raineszm
Copy link
Contributor

I'm also seeing this issue.

OS: MacOS 11.1
Obsidian: v0.10.1 (installer 0.9.22)

No errors in the console, although the active leaf appears to be printed.

@hans
Copy link
Owner

hans commented Dec 18, 2020

Hi both, thanks for the report! Can you please confirm you're on the latest version of the plugin (0.3.0) ?

@raineszm
Copy link
Contributor

Yes. This is on 0.3.0.

@hans hans added the bug Something isn't working label Dec 18, 2020
@xldenis
Copy link

xldenis commented Dec 18, 2020

I'm also getting this issue on the latest version!

@atomashevic
Copy link
Author

Just to confirm, it's latest version (0.3.0).

@hans
Copy link
Owner

hans commented Dec 18, 2020

Hmm, I can't reproduce this bug, even with the same Obsidian version and plugin version. Would one of you be willing to share your citation library export?

@raineszm
Copy link
Contributor

Hmm, I can't reproduce this bug, even with the same Obsidian version and plugin version. Would one of you be willing to share your citation library export?

I'd be happy to provide an exported JSON file. I see the problem with my full library which is about 900 items but also with a smaller subset.

Exported Items.json.txt

@atomashevic
Copy link
Author

Here's a smaller subset of my library where I have the same issue.

https://filebin.net/a89izm7wwvd4t8qm

Thanks!

@hans
Copy link
Owner

hans commented Dec 19, 2020

I'm still failing to reproduce this even with your citation libraries, but I'll try again on a totally clean VM install and keep you posted.

@raineszm
Copy link
Contributor

raineszm commented Dec 21, 2020

This issue appears to be this event handler

this.inputEl.addEventListener("keyup", (ev) => this.onInputKeyup(ev));

I think that when calling these functions from the command palette, the event handler is getting the key up of the command submission and immediately submitting the modal. This aligns with the fact that things work fine if I use the assigned hotkeys instead of calling from the command palette.

Edit:
Commenting this line out causes the prompt to appear as expected. Out of curiosity, do you usually run the command using the hotkeys?

@hans
Copy link
Owner

hans commented Dec 21, 2020

@raineszm Thanks a lot for tracking this down. I realize just now that I didn't understand the problem in the first place — I was taking "run command" to mean "run the command via hotkey."

This should be an easy fix -- I'll fix this later today.

hans added a commit that referenced this issue Dec 21, 2020
…iously to launch modal don't get intercepted. Fixes #15.
@hans
Copy link
Owner

hans commented Dec 21, 2020

Fixed & will be shipped with the next release, coming very soon. Thanks everyone for pitching in :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants