(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
pull/3/head
Dmitry S 3 years ago
parent 8156f957b3
commit d3ab07d748

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

Loading…
Cancel
Save