web/elements: fix initialLoad not being done when viewportCheck was disabled
closes #1497 Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
8359f0bfb3
commit
f723fdd551
|
@ -48,11 +48,17 @@ export abstract class ModelForm<T, PKT extends string | number> extends Form<T>
|
||||||
}
|
}
|
||||||
|
|
||||||
render(): TemplateResult {
|
render(): TemplateResult {
|
||||||
|
if (this._instancePk) {
|
||||||
|
if (
|
||||||
// if we're in viewport now and haven't loaded AND have a PK set, load now
|
// if we're in viewport now and haven't loaded AND have a PK set, load now
|
||||||
if (this.isInViewport && !this._initialLoad && this._instancePk) {
|
(this.isInViewport && !this._initialLoad) ||
|
||||||
|
// Or if we don't check for viewport in some cases
|
||||||
|
!this.viewportCheck
|
||||||
|
) {
|
||||||
this.instancePk = this._instancePk;
|
this.instancePk = this._instancePk;
|
||||||
this._initialLoad = true;
|
this._initialLoad = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return super.render();
|
return super.render();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue