Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drag-overlay.md: note about click events #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion api-documentation/draggable/drag-overlay.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ You may render any valid JSX within the children of the `<DragOverlay>`. However

The `<DragOverlay>` component should **remain mounted at all times** so that it can perform the drop animation. If you conditionally render the `<DragOverlay>` component, drop animations will not work.

As a rule of thumb, try to render the `<DragOverlay>` outside fo your draggable components, and follow the [presentational component pattern ](drag-overlay.md#presentational-components)to maintain a good separation of concerns.
As a rule of thumb, try to render the `<DragOverlay>` outside of your draggable components, and follow the [presentational component pattern ](drag-overlay.md#presentational-components)to maintain a good separation of concerns.

Instead, you should conditionally render the children passed to the `<DragOverlay>`:

Expand Down Expand Up @@ -222,6 +222,10 @@ function App() {
}
```

### Click events

With default settings, a `DragOverlay` will prevent `click` events from firing on your draggable element because the `DragOverlay` is displayed over top of the draggable. To fix this, add a delay or distance-based [activation constraint](../sensors/pointer.md#activation-constraints) or use a drag handle.

## Props

```typescript
Expand Down