Skip to content

Commit

Permalink
fix: could fix, maybe, adjustToContentHeight #219
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremybarbet committed Aug 12, 2020
1 parent 9dd3396 commit bebd6ec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,9 @@ const ModalizeBase = (
setLayouts(new Map(layouts.set(component, height)));

const max = Array.from(layouts).reduce((acc, cur) => acc + cur?.[1], 0);
const shorterHeight = max < endHeight;
const maxFixed = +max.toFixed(3);
const endHeightFixed = +endHeight.toFixed(3);
const shorterHeight = maxFixed < endHeightFixed;

setDisableScroll(shorterHeight && disableScrollIfPossible);
};
Expand Down

0 comments on commit bebd6ec

Please sign in to comment.