[BUG] Quick Citation dialog does not close on focus loss

edited November 19, 2024
Hi,

When focus is lost from the Quick Citation dialog, it does not currently close. I'm unsure if this is expected behaviour, or whether it is unwanted.

It appears definitely unwanted if you are editing multiple citations, and click out of the window, then select another citation. The Quick Citation dialog then reflects (and will update) the first selected citation.

Steps to repro:

1) Open Word
2) Insert two citations (and press enter/accept each one to accept).
3) Select one citation, and press Add/Edit to open the Quick Citation dialog
4) Without pressing escape, or accepting the dialog, click back into word, and select the second citation
5) Notice the dialog is still reflecting the first citation

With a single line of code I believe I've fixed the issue, there appears to be no problem utilising the dialog from my end, but appreciate I cannot test on other platforms/with other word processors.

OS: Windows 11 23H2 22631.4317
Zotero: 7.0.10-beta.2+dc47650eb (64-bit) (also last stable version)

https://github.com/zotero/zotero/pull/4854

Thanks,

Dave

https://s3.amazonaws.com/zotero.org/images/forums/u13789074/wt0ha31702ln2q0ocrlw.png

  • No, this is intentional. You're supposed to be able to move focus away from the citation dialog to look something want and then return to it.

    Since there is only one word integration operation allowed at the time with Zotero, when the focus is removed from the citation dialog, clicking any button in Word should return focus to the citation dialog (this unfortunately doesn't always work depending on the OS and word processor used).

    I've created an issue about improving the experience for interacting with the word plugins when a citation dialog is already displayed, but it's going to take a bit more work.
  • Hi Adomasven,

    Is there any chance this could be an setting for users to choose?

    It left my assignment massively broken as I hadn't spotted what it was doing, and I had to go back through almost every citation to check it.

    You can carry on using word with the citation dialog just sitting in the background, blissfully unaware it's there!

    Thanks :)

    Dave
  • Not sure how this would have caused brokeness, or how your change would help. If the citation dialog had closed without accepting your changes when you moved focus away from it, wouldn't you have the same situation as now? I.e. presumably you've made edits that didn't get saved, but if you wouldn't submit the dialog and it moving focus away would just close it, your edits would also not get saved.
  • edited November 20, 2024
    Hi,

    No, I'm not expecting edits made to be saved in this case. So if you don't deliberately press escape (or accept changes), it won't close and it won't update when selecting another citation.

    Think going to insert a citation then changing your mind (or changing task, or scrolling through the document), or checking citations (for instance, you've omitted the author, so you're checking that the correct citation is there by selecting it and clicking add/edit).

    If you then go and select (or go to insert) another citation, you then think that the citation you've just selected is incorrect (since the citation edit dialog has not updated to the new citation), then if you change it, and accept changes, you've now got an erroneous citation.

    Another point, if you go to insert a citation, then change your mind (and don't escape out of the dialog), then try to insert one somewhere else, it'll get inserted at the first point you tried to insert it.

    IMO either the dialog needs to close or update when selecting another citation (or prompting if you want to save changes to it you have made, if any), but this action may not fix the inserting in the wrong place bug.
  • Further to the last comment, it would appear that the Quick citation dialog works correctly as you describe in the Zotero app when editing Notes.

    I.e. it has the behaviour you describe, it will stay open when losing focus, however, if you select another citation (and press edit) it will open a new dialog with the correct citation selected, or if inserting a new one, will open a blank dialog with the caret in the correct place.

    It is the integrated dialog which does not work as I would expect! :)

Sign In or Register to comment.