(core) Make ProfileDialog wait consistently for work to finish before closing.

Summary: - Added functionality to modal.ts to allow pending work to delay the closing of the dialog.

Test Plan: Added a test case that tickled a failure previously.

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D3071
This commit is contained in:
Dmitry S
2021-10-12 11:59:12 -04:00
parent 9d1cc89dc9
commit 16eb158673
3 changed files with 141 additions and 51 deletions

View File

@@ -899,7 +899,8 @@ GridView.prototype.buildDom = function() {
dom.on('contextmenu', ev => {
// This is a little hack to position the menu the same way as with a click
ev.preventDefault();
ev.currentTarget.querySelector('.g-column-menu-btn').click();
const btn = ev.currentTarget.querySelector('.g-column-menu-btn');
if (btn) { btn.click(); }
}),
dom('div.g-column-label',
kf.editableLabel(field.displayLabel, isEditingLabel, renameCommands),