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

itemBox: fix creator row removed on label click #5137

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

abaevbog
Copy link
Contributor

@abaevbog abaevbog commented Mar 19, 2025

  • do not add regular label click handling that refocuses itemTree/reader (d3cee95) to creator rows, since their labels should just open the creator type dropdown on click. Having focus moved from itemBox to itemTree/reader when an empty creator is present would remove it. With this, an empty creator row will remain.

  • do not blur currently focused field when the creator type dropdown closes via "blur-on-hidden" class. That logic was
    added to make sure that focus does not land on the dropdown (which keeps all row's icons visible after popup goes away). Instead, prevent focus via event.preventDefault() on mousedown event. Now, when the popup appears, the currently focused field just remains focused.

Fixes: #5117

Screen.Recording.2025-03-19.at.4.02.35.PM.mov

- do not add regular label click handling that refocuses itemTree/reader
(d3cee95)
to creator rows, since their labels should just open
the creator type dropdown on click. Having focus moved from
itemBox to itemTree/reader when an empty creator is present
would remove it. With this, an empty creator row will remain.

- do not blur currently focused field when the creator type
dropdown closes via "blur-on-hidden" class. That logic was
added to make sure that focus does not land on the
dropdown (which keeps all row's icons visible after
popup goes away). Instead, prevent focus via
event.preventDefault on mousedown event. Now, when
the popup appears, the currently focused field just
remains focused.

Fixes: zotero#5117
@abaevbog abaevbog force-pushed the 5117_itembox_creatorLabel_focus branch from bb64469 to 29e45a8 Compare March 19, 2025 23:22
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.

Creator disappears when changing type
1 participant