(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
This commit is contained in:
Dmitry S 2021-02-09 18:38:05 -05:00
parent 8156f957b3
commit d3ab07d748

View File

@ -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 = {