(core) Fixing scrolly bug on mobile

Summary:
On mobile view not all rows are rendered when a section is expanded.
Scrolly component calculates height of the GridView too soon (before animation is
completed). With this change on mobile view we always take the screen height for
calculation.

A similar bug was on Card List, where cards were squeezed and their height was
calculated to soon.

Test Plan: Added test

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D3748
This commit is contained in:
Jarosław Sadziński
2023-01-04 17:37:32 +01:00
parent cd72a54bbb
commit d107810127
4 changed files with 45 additions and 15 deletions

View File

@@ -227,8 +227,13 @@ export function getSection(sectionOrTitle: string|WebElement): WebElement|WebEle
* Click into a section without disrupting cursor positions.
*/
export async function selectSectionByTitle(title: string) {
// .test-viewsection is a special 1px width element added for tests only.
await driver.findContent(`.test-viewsection-title`, title).find(".test-viewsection-blank").click();
try {
// .test-viewsection is a special 1px width element added for tests only.
await driver.findContent(`.test-viewsection-title`, title).find(".test-viewsection-blank").click();
} catch (e) {
// We might be in mobile view.
await driver.findContent(`.test-viewsection-title`, title).findClosest(".view_leaf").click();
}
}
@@ -2319,9 +2324,8 @@ export function bigScreen() {
/**
* Shrinks browser window dimensions to trigger mobile mode for a test suite.
*/
export function narrowScreen() {
export function narrowScreen() {
resizeWindowForSuite(400, 750);
}
export async function addSupportUserIfPossible() {