Skip to content

Commit

Permalink
Merge branch 'main' into UXRFC-439
Browse files Browse the repository at this point in the history
  • Loading branch information
Arucard89 authored Jan 23, 2025
2 parents 1cb5bc8 + 3f580e1 commit 449ee3d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/FilePreview/FilePreview.scss
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ $smallRoundedButtonSize: 24px;
width: 96px;
}

&-image {
&__image {
position: absolute;
inset-block-start: 0;
inset-inline-start: 0;
Expand Down
15 changes: 13 additions & 2 deletions src/components/Sheet/SheetContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ interface SheetContentState {
veilTouched: boolean;
isAnimating: boolean;
inWindowResizeScope: boolean;
delayedResize: boolean;
}

class SheetContent extends React.Component<SheetContentInnerProps, SheetContentState> {
Expand Down Expand Up @@ -86,6 +87,7 @@ class SheetContent extends React.Component<SheetContentInnerProps, SheetContentS
veilTouched: false,
isAnimating: false,
inWindowResizeScope: false,
delayedResize: false,
};

componentDidMount() {
Expand Down Expand Up @@ -333,12 +335,14 @@ class SheetContent extends React.Component<SheetContentInnerProps, SheetContentS
y: e.nativeEvent.touches[0].clientY,
});

this.setState({deltaY: delta});

// if allowHideOnContentScroll is true and delta <= 0, it's a content scroll
// animation is not needed
if (delta <= 0) {
this.setState({deltaY: 0});
return;
}

this.setState({deltaY: delta});
this.setStyles({status: 'showing', deltaHeight: delta});
};

Expand Down Expand Up @@ -397,6 +401,12 @@ class SheetContent extends React.Component<SheetContentInnerProps, SheetContentS

if (this.veilOpacity === '0') {
this.props.hideSheet();
return;
}

if (this.state.delayedResize) {
this.onResizeWindow();
this.setState({delayedResize: false});
}
};

Expand All @@ -410,6 +420,7 @@ class SheetContent extends React.Component<SheetContentInnerProps, SheetContentS

private onResizeWindow = () => {
if (this.state.isAnimating) {
this.setState({delayedResize: true});
return;
}

Expand Down

0 comments on commit 449ee3d

Please sign in to comment.