Skip to content

Commit

Permalink
fix: prevent dnd propagation in select context to prevent accidental …
Browse files Browse the repository at this point in the history
…uploads with native inputs
  • Loading branch information
robinpyon committed Feb 26, 2021
1 parent 14462ab commit 6fe2297
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const AssetBrowser: FC<Props> = (props: Props) => {
// prematurely closing, as it attaches events on `document` to detect outside clicks.
const handleStopPropagation = (e: MouseEvent) => {
e.nativeEvent.stopImmediatePropagation()
e.stopPropagation()
}

return (
Expand All @@ -42,6 +43,10 @@ const AssetBrowser: FC<Props> = (props: Props) => {
) : (
<Portal>
<Box
onDragEnter={handleStopPropagation}
onDragLeave={handleStopPropagation}
onDragOver={handleStopPropagation}
onDrop={handleStopPropagation}
onMouseUp={handleStopPropagation}
style={{
bottom: 0,
Expand Down

0 comments on commit 6fe2297

Please sign in to comment.