From d3ab07d748b640899fec1ba25de15350178d2c75 Mon Sep 17 00:00:00 2001 From: Dmitry S Date: Tue, 9 Feb 2021 18:38:05 -0500 Subject: [PATCH] (core) When active section changes, tell it to resize its content (which it can't do while hidden) Test Plan: Tested manually on iPhone and android simulator. On Desktop mode, resize isn't needed, but seems harmless (I can't see any artifacts caused by it). Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D2728 --- app/client/components/ViewLayout.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/client/components/ViewLayout.ts b/app/client/components/ViewLayout.ts index 57e58960..9584cf40 100644 --- a/app/client/components/ViewLayout.ts +++ b/app/client/components/ViewLayout.ts @@ -123,7 +123,8 @@ export class ViewLayout extends DisposableWithEvents implements IDomComponent { const classActive = cssLayoutBox.className + '-active'; const classInactive = cssLayoutBox.className + '-inactive'; - this.autoDispose(subscribe(fromKo(this.viewModel.activeSectionId), (use, id) => { + this.autoDispose(subscribe(fromKo(this.viewModel.activeSection), (use, section) => { + const id = section.getRowId(); this._layout.forEachBox((box: {dom: Element}) => { box.dom.classList.add(classInactive); box.dom.classList.remove(classActive); @@ -134,6 +135,7 @@ export class ViewLayout extends DisposableWithEvents implements IDomComponent { elem.classList.add(classActive); elem = elem.parentElement; } + section.viewInstance.peek()?.onResize(); })); const commandGroup = {