fix: draggable modal demo

This commit is contained in:
Junior Garcia 2024-12-06 12:07:44 -03:00
parent 1d39358bd5
commit b1f79d4310
2 changed files with 4 additions and 4 deletions

View File

@ -52,8 +52,8 @@ Upgrade today by running one of the following commands:
<PackageManagers
commands={{
cli: "nextui upgrade",
npm: "npx nextui-cli@latest upgrade",
cli: "nextui upgrade --all",
npm: "npx nextui-cli@latest upgrade --all",
}}
/>
@ -514,7 +514,7 @@ See the [Dark Mode documentation](/docs/customization/dark-mode) for more detail
Added support for draggable modals.
<CodeDemo title="Draggable Modal" showEditor={false} files={modalContent.draggable} />
<CodeDemo title="Draggable Modal" files={modalContent.draggable} />
<Spacer y={4} />

View File

@ -12,7 +12,7 @@ import {
export default function App() {
const {isOpen, onOpen, onOpenChange} = useDisclosure();
const targetRef = React.useRef(null);
const {moveProps} = useDraggable({targetRef});
const {moveProps} = useDraggable({targetRef, isDisabled: !isOpen});
return (
<>