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 73d57d6f82
commit d0c56325ef
1 changed files with 2 additions and 2 deletions

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
) {