(core) Prevent error when there are no visible columns

Test Plan: Set all columns to hidden and reloaded document.

Reviewers: dsagal

Reviewed By: dsagal

Differential Revision: https://phab.getgrist.com/D2832
This commit is contained in:
Alex Hall 2021-05-24 19:56:50 +02:00
parent d1c1416d78
commit 7758cb830d

View File

@ -969,7 +969,8 @@ GridView.prototype.buildDom = function() {
/** @inheritdoc */
GridView.prototype.onResize = function() {
if (this.activeFieldBuilder().isEditorActive()) {
const activeFieldBuilder = this.activeFieldBuilder();
if (activeFieldBuilder && activeFieldBuilder.isEditorActive()) {
// When the editor is active, the common case for a resize is if the virtual keyboard is being
// shown on mobile device. In that case, we need to scroll active cell into view, and need to
// do it synchronously, to allow repositioning the editor to it in response to the same event.