web/elements: fix model form always loading when viewport check is disabled

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-10-05 11:23:45 +02:00
parent 16f2603130
commit b0e416e9f0

View file

@ -48,10 +48,10 @@ export abstract class ModelForm<T, PKT extends string | number> extends Form<T>
}
render(): TemplateResult {
if (this._instancePk) {
if (this._instancePk && !this._initialLoad) {
if (
// if we're in viewport now and haven't loaded AND have a PK set, load now
(this.isInViewport && !this._initialLoad) ||
this.isInViewport ||
// Or if we don't check for viewport in some cases
!this.viewportCheck
) {