Swap Promise for jQuery.Promise in loadingFinished() & doLoadingFinished()

This lets us add LitElement's updateComplete Promise into the list of things to wait for, and solves the problem of app init code being run before widgets are complete.

https://lit.dev/docs/components/lifecycle/#reactive-update-cycle-completing
This commit is contained in:
nathan
2022-03-08 15:11:32 -07:00
parent 1b74f1f1a7
commit f7f4053d1a
9 changed files with 145 additions and 120 deletions

View File

@@ -18,7 +18,7 @@ import {et2_no_init} from "./et2_core_common";
import {ClassWithAttributes} from "./et2_core_inheritance";
import {et2_widget, WidgetConfig} from "./et2_core_widget";
import {et2_valueWidget} from './et2_core_valueWidget'
import {et2_IInput, et2_IInputNode, et2_ISubmitListener} from "./et2_core_interfaces";
import {et2_IInput, et2_ISubmitListener} from "./et2_core_interfaces";
import {et2_compileLegacyJS} from "./et2_core_legacyJSFunctions";
// fixing circular dependencies by only importing the type (not in compiled .js)
import type {et2_tabbox} from "./et2_widget_tabs";
@@ -107,7 +107,7 @@ export class et2_inputWidget extends et2_valueWidget implements et2_IInput, et2_
/**
* Make sure dirty flag is properly set
*/
doLoadingFinished(): boolean | JQueryPromise<unknown>
doLoadingFinished() : boolean | Promise<unknown>
{
let result = super.doLoadingFinished();