Fix post-save textbox focusing bugs in right-hand pane
Fix a couple cases of lost text field focus after an edit, including focusing of the Title field after using New Item when a field is already being edited and has a changed value. Also, in tests, select My Library and wait for items to load when using the loadZoteroPane() support function. We could add a parameter to skip that or move it to a separate function, but the code to detect it is a bit convoluted and it's a prerequisite for many tests, so it's handy to have a function for it.
This commit is contained in:
parent
590649fd49
commit
8fec5ace3a
7 changed files with 103 additions and 63 deletions
|
@ -4,25 +4,13 @@ describe("Zotero.ItemTreeView", function() {
|
|||
// Load Zotero pane and select library
|
||||
before(function* () {
|
||||
win = yield loadZoteroPane();
|
||||
var zp = win.ZoteroPane;
|
||||
var cv = zp.collectionsView;
|
||||
var resolve1, resolve2;
|
||||
var promise1 = new Zotero.Promise(() => resolve1 = arguments[0]);
|
||||
var promise2 = new Zotero.Promise(() => resolve2 = arguments[0]);
|
||||
cv.addEventListener('load', () => resolve1())
|
||||
yield promise1;
|
||||
cv.selection.select(0);
|
||||
zp.addEventListener('itemsLoaded', () => resolve2());
|
||||
yield promise2;
|
||||
itemsView = zp.itemsView;
|
||||
itemsView = win.ZoteroPane.itemsView;
|
||||
|
||||
var item = new Zotero.Item('book');
|
||||
existingItemID = yield item.save();
|
||||
});
|
||||
after(function () {
|
||||
if (win) {
|
||||
win.close();
|
||||
}
|
||||
win.close();
|
||||
});
|
||||
|
||||
describe("#selectItem()", function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue