fix: fix blank page if stack was inside display: none before

This commit is contained in:
Satyajit Sahoo
2020-03-19 18:11:55 +01:00
parent b1a65fc73e
commit 49f6fed6d3

View File

@@ -160,7 +160,16 @@ const getProgressFromGesture = (
layout: Layout,
descriptor?: StackDescriptor
) => {
const distance = getDistanceFromOptions(mode, layout, descriptor);
const distance = getDistanceFromOptions(
mode,
{
// Make sure that we have a non-zero distance, otherwise there will be incorrect progress
// This causes blank screen on web if it was previously inside container with display: none
width: Math.max(1, layout.width),
height: Math.max(1, layout.height),
},
descriptor
);
if (distance > 0) {
return gesture.interpolate({