Skip to content

Commit

Permalink
Close dismissible correctly (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilkowalski authored Sep 7, 2023
1 parent 13aadee commit a8e244f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

import * as DialogPrimitive from '@radix-ui/react-dialog';
import React from 'react';
import { useControllableState } from './use-controllable-state';
import { DrawerContext, useDrawerContext } from './context';
import './style.css';
import { usePreventScroll, isInput, isIOS } from './use-prevent-scroll';
import { useComposedRefs } from './use-composed-refs';
import { useSafariThemeColor } from './use-safari-theme-color';
import { usePositionFixed } from './use-position-fixed';
import { useSnapPoints } from './use-snap-points';
import { set, reset, getTranslateY, isInView, dampenValue } from './helpers';
import { set, reset, getTranslateY, dampenValue } from './helpers';
import { TRANSITIONS, VELOCITY_THRESHOLD } from './constants';

const CLOSE_THRESHOLD = 0.25;
Expand Down Expand Up @@ -334,7 +333,7 @@ function Root({
}, [activeSnapPointIndex, snapPoints, snapPointsOffset]);

function closeDrawer() {
if (!dismissible || !drawerRef.current) return;
if (!drawerRef.current) return;

onClose?.();
if (drawerRef.current) {
Expand Down Expand Up @@ -652,7 +651,6 @@ const Content = React.forwardRef<HTMLDivElement, ContentProps>(function (
onRelease,
onDrag,
dismissible,
isOpen,
keyboardIsOpen,
snapPointsOffset,
visible,
Expand Down

0 comments on commit a8e244f

Please sign in to comment.