Skip to content

Fix: prevent annotation freeze when editing comments in sidebar - #232

Closed
MattesMrzik wants to merge 1 commit into
zotero:masterfrom
MattesMrzik:fix/focus-deselect
Closed

Fix: prevent annotation freeze when editing comments in sidebar#232
MattesMrzik wants to merge 1 commit into
zotero:masterfrom
MattesMrzik:fix/focus-deselect

Conversation

@MattesMrzik

@MattesMrzik MattesMrzik commented Jul 20, 2026

Copy link
Copy Markdown

Problem

When editing annotation comments in the PDF reader sidebar, Zotero freezes completely. This has been reported by multiple users on macOS and Windows:

@MattesMrzik
MattesMrzik force-pushed the fix/focus-deselect branch 2 times, most recently from 56076df to 3d9a3f9 Compare July 20, 2026 13:24
FocusManager._handleFocus deselects annotations when any focus event
fires outside .annotation elements. During React re-renders of the
contentEditable comment editor, focus fires on elements momentarily
outside .annotation, creating an infinite deselect→re-select cycle that
freezes the UI with large annotation sets.

Added [contenteditable="true"] to the exclusion selector list.
@MattesMrzik
MattesMrzik marked this pull request as draft July 20, 2026 15:17
@MattesMrzik

MattesMrzik commented Jul 21, 2026

Copy link
Copy Markdown
Author

this was not a correct fix. see https://forums.zotero.org/discussion/129829/trouble-since-update-zotero-8 what actually helped:
Evidence (from sample output of the frozen process, 2393 samples taken):
2393 Thread main thread, all samples in same call chain
→ CopyAttributeValue → NSAccessibilityGetObjectForAttributeUsingLegacyAPI
→ ??? (in XUL)

??? (0x4db7e44) → 1534 samples
??? (0x4db6db0) → 1534
??? (0x4d9c390) → 1491
??? (0x4d9ba58) → 1461
??? (0x4d9b33c) → 657
??? (0x4c74750) → 557
??? (0x4c786a4) → 183 ... (same addresses recursing)
All 2393 samples are within a single CopyAttributeValue — Firefox's nsIAccessibleMacInterface::getAttributeValue() calls itself recursively 1500+ times without returning. This is an infinite recursion inside the prebuilt XUL binary (Zotero.app/Contents/MacOS/XUL), not in Zotero's own code.
Root cause: An internal infinite recursion in Firefox's compiled C++ accessibility handler, triggered when FullKeyboardAccessFocusRingEnabled is active on macOS and the user edits an annotation comment.
Fix: Add to your Zotero profile's user.js:

echo 'user_pref("accessibility.force_disabled", 1);' \
> ~/Library/Application\ Support/Zotero/Profiles/*.default/user.js

This tells Firefox to skip registering its AX handler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant