After new item creation, focus title in itemBox (#4113)

When item is created manually, title field in itemBox
will be focused instead of the title in the itemPane as before.
If the itemBox is collapsed, it will be opened.

Added 'open' setter to item pane section for brevity

Fixes #4111
This commit is contained in:
Bogdan Abaev 2024-05-10 17:46:31 -04:00 committed by Dan Stillman
parent c01b3ae270
commit be1c890051
4 changed files with 21 additions and 15 deletions

View file

@ -18,9 +18,8 @@ describe("ZoteroPane", function() {
describe("#newItem", function () {
it("should create an item and focus the title field", function* () {
yield zp.newItem(Zotero.ItemTypes.getID('book'), {}, null, true);
let title = doc.getElementById('zotero-item-pane-header').querySelector("editable-text");
assert.equal(doc.activeElement.getAttribute("aria-label"), title.getAttribute("aria-label"));
title.blur();
assert.equal(doc.activeElement.closest("editable-text").id, "itembox-field-value-title");
doc.activeElement.blur();
yield Zotero.Promise.delay(1);
})