You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/@react-spectrum/dropzone/docs/DropZone.mdx
+48-33Lines changed: 48 additions & 33 deletions
Original file line number
Diff line number
Diff line change
@@ -357,52 +357,67 @@ function Example() {
357
357
358
358
A DropZone displays visual feedback to the user when a drag hovers over the drop target by passing the `getDropOperation` function. If a drop target only supports data of specific types (e.g. images, videos, text, etc.), then it should implement the `getDropOperation` prop and return `'cancel'` for types that aren't supported. This will prevent visual feedback indicating that the drop target accepts the dragged data when this is not true. [Read more about getDropOperation.](../react-aria/useDrop.html#getdropoperation)
359
359
360
+
In the below example, the drop zone only supports dropping JPEG images. If a JPEG is dragged over the drop zone, it will be highlighted and the operating system will display a copy cursor. If another type is dragged over the drop zone, then there is no visual feedback, indicating that a drop is not accepted.
361
+
360
362
```tsx example
361
363
import {FileTrigger} from'react-aria-components';
362
364
import {Text} from'react-aria-components';
363
-
import {FileDropItem} from'react-aria';
364
365
365
366
function Example() {
366
367
let [filledSrc, setFilledSrc] =React.useState(null);
0 commit comments