used to announce which annotation is selected during
keyboard navigation, as well as the index of the current
search result
Followup to zotero/reader#130
- always render options and link buttons - just do
not display them if their respective field is empty.
That allows us to easily handle focus after refresh
because otherwise, the node may does not exist.
If we try to restore focus to such hidden component,
simulate a "tab" from it to focus the next possible node.
This fixes the issue of focus being lost on tab after all
content of editable-text is cleared.
- add tabindex=0 to itemType menulist, otherwise it was
not perceived as a candidate to return focus to.
- somewhat special treatment for restoring focus to
creator rows. If the desired node is not found, we'll
try to focus the respective node in the last creator row.
It prevents focus from being lost on tab after clearing
the very last creator.
Fixes: #4241
this._addCreatorRow needs to be properly initialized to
false (as opposed to being undefined) because 'false'
is the value we check against to decide if an empty
row should be added and focused after rendering.
Fixes: #4268
- only have enabled "Permanently delete" and "Restore to library"
options in the context menu for collections and searches in the trash
- display the custom header with buttons to delete or restore
in the itemPane when a collection or search in the trash is selected
Fixes: #4295
* Fix template and preview overflowing container
* Fix extra whitespace around "documentation" link
* Increase minimal height of the template input field
a532cfb475 added `isCollection()`, `isSearch()`, and `isItem()` methods
to data objects to handle collections and searches in the trash, with
`isItem()` checking whether `._ObjectType` was `Item`. That left out
feed items (`._ObjectType` == `FeedItem`), and when c384fef867 made
`getSelectedItems()` return only items, it used `isItem()`, so feed
items were excluded, which broke feed-item toggling between read and
unread [1] and possibly some other things.
The simple fix would be to make `isItem` match feed items as well (which
could potentially fix other bugs related to feed items), but there was
actually no need to add new methods (which can get confused with
`CollectionTreeRow` methods) when we can just check the object type with
`obj instanceof Zotero.Item`, which gets the benefit of inheritance and
matches `Zotero.FeedItem` instances as well.
[1] https://forums.zotero.org/discussion/115571/cannot-change-the-status-of-title-in-subscribtion
Fix to breakage after 3f45def that would not open a duplicate
tab but instead create another reader instance in the same tab.
Instead of finding a tab for a specific item, use tabID that
is passed when reader should be loaded in an unloaded tab. That
allows us to know if the tab is being duplicated or not.
Fixes: #4272
Sidenav button pane IDs usually correspond to sections with the same
IDs, but `context-notes` actually corresponds to two sections
(`context-all-notes` and `context-item-notes`). We were preventing
those sections from being pinned, but not the button that reveals them.
Fixes#4283
This changes `createDataObject()` to pass `skipSelect: true` for objects
other than items. If a test is creating a bunch of collections, there's
no reason for each one to be selected and for an items list to start to
load. If a test does need a new collection or search to be selected, it
can call the new convenience function `await select(win, obj)`, which
will select the passed object in the collection tree and wait for its
items list to load. I'm hoping this reduces random test failures due to
items list churn.