Skip to content

Commit 3e277e7

Browse files
authored
fix dropzone hover props (#5384)
1 parent 6f23ea1 commit 3e277e7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

packages/@react-spectrum/dropzone/src/DropZone.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import React, {ReactNode} from 'react';
2020
import styles from '@adobe/spectrum-css-temp/components/dropzone/vars.css';
2121
import {useLocalizedStringFormatter} from '@react-aria/i18n';
2222

23-
export interface SpectrumDropZoneProps extends DropZoneProps, DOMProps, StyleProps, AriaLabelingProps {
23+
export interface SpectrumDropZoneProps extends Omit<DropZoneProps, 'onHoverStart' | 'onHoverChange' | 'onHoverEnd'>, DOMProps, StyleProps, AriaLabelingProps {
2424
/** The content to display in the drop zone. */
2525
children: ReactNode,
2626
/** Whether the drop zone has been filled. */
@@ -29,6 +29,13 @@ export interface SpectrumDropZoneProps extends DropZoneProps, DOMProps, StylePro
2929
replaceMessage?: string
3030
}
3131

32+
// Filter out props used by RAC DropZone that we don't want in RSP DropZone for now.
33+
let filterProps = (props) => {
34+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
35+
let {onHoverStart, onHoverChange, onHoverEnd, ...otherProps} = props;
36+
return otherProps;
37+
};
38+
3239
function DropZone(props: SpectrumDropZoneProps, ref: DOMRef<HTMLDivElement>) {
3340
let {children, isFilled, replaceMessage, ...otherProps} = props;
3441
let {styleProps} = useStyleProps(props);
@@ -38,7 +45,7 @@ function DropZone(props: SpectrumDropZoneProps, ref: DOMRef<HTMLDivElement>) {
3845

3946
return (
4047
<RACDropZone
41-
{...mergeProps(otherProps)}
48+
{...mergeProps(filterProps(otherProps))}
4249
{...styleProps as Omit<React.HTMLAttributes<HTMLElement>, 'onDrop'>}
4350
aria-labelledby={isFilled && messageId}
4451
className={

0 commit comments

Comments
 (0)