Skip to content

Commit

Permalink
fix: don't keep bottom sheet mounted
Browse files Browse the repository at this point in the history
  • Loading branch information
chybisov committed Oct 6, 2022
1 parent 6083a86 commit 861bec5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/widget/src/components/AppContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const RelativeContainer = styled(Box, {
const CssBaselineContainer = styled(ScopedCssBaseline, {
shouldForwardProp: (prop) => prop !== 'variant',
})<{ variant?: WidgetVariant }>(({ variant }) => ({
position: 'relative',
display: 'flex',
flex: 1,
flexDirection: 'column',
Expand Down
5 changes: 4 additions & 1 deletion packages/widget/src/components/BottomSheet/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export const BottomSheet = forwardRef<BottomSheetBase, BottomSheetProps>(
position: 'absolute',
overflow: 'hidden',
},
keepMounted: true,
}}
PaperProps={{
sx: (theme) => ({
Expand All @@ -67,6 +66,10 @@ export const BottomSheet = forwardRef<BottomSheetBase, BottomSheetProps>(
SlideProps={{
container: containerElement,
}}
disableAutoFocus
disableEnforceFocus
disableScrollLock
disablePortal
>
{children}
</Drawer>
Expand Down
2 changes: 1 addition & 1 deletion packages/widget/src/pages/SwapPage/StatusBottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export const StatusBottomSheet: React.FC<RouteExecution> = ({
const { navigateBack, navigate } = useNavigateBack();
const ref = useRef<BottomSheetBase>(null);
const { getChainById } = useChains();
const { setValue } = useFormContext();
const { token, refetch, refetchNewBalance, refetchAllBalances } =
useTokenBalance(route.toToken, route.toAddress);
const { setValue } = useFormContext();

const clearFromAmount = () => {
refetchAllBalances();
Expand Down

0 comments on commit 861bec5

Please sign in to comment.