Skip to content

Commit

Permalink
🐛 Forhindre at vedlegg åpnes i ny fane ved drop. Sett dragover til fa…
Browse files Browse the repository at this point in the history
…lse ved drop

Co-authored-by: Thomas Rognes <[email protected]>
Co-authored-by: Øivind Stensrud <[email protected]>
  • Loading branch information
3 people committed Oct 6, 2023
1 parent 5a2ea8a commit f8bd8af
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/aap-felles-react/src/FileInput/FileInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,11 @@ export const FileInput = (props: FileInputProps) => {
onDragLeave={() => setDragOver(false)}
onDragOver={(e) => e.preventDefault()}
onDrop={(e) => {
e.preventDefault();
if (e.dataTransfer.files) {
validateAndSetFiles(e.dataTransfer.files);
}
setDragOver(false);
}}
>
{isUploading ? (
Expand Down

0 comments on commit f8bd8af

Please sign in to comment.