diff --git a/react/features/file-sharing/components/web/FileSharing.tsx b/react/features/file-sharing/components/web/FileSharing.tsx index 77bac71725..9d2d01d717 100644 --- a/react/features/file-sharing/components/web/FileSharing.tsx +++ b/react/features/file-sharing/components/web/FileSharing.tsx @@ -237,6 +237,7 @@ const FileSharing = () => { if (e.target.files) { processFiles(e.target.files as FileList, store); e.target.value = ''; // Reset the input value to allow re-uploading the same file + e.target.blur(); // Remove focus so Enter/Space won't retrigger } }, [ processFiles ]); @@ -255,6 +256,8 @@ const FileSharing = () => { }, []); const handleKeyPress = useCallback((e: React.KeyboardEvent) => { + e.preventDefault(); + e.stopPropagation(); if (e.key === 'Enter' || e.key === ' ') { fileInputRef.current?.click(); } @@ -272,19 +275,15 @@ const FileSharing = () => { onDragEnter = { handleDragEnter } onDragLeave = { handleDragLeave } onDragOver = { handleDragOver } - onDrop = { handleDrop } - role = 'button' - tabIndex = { 0 }> - - + onDrop = { handleDrop } /> { sortedFiles.length === 0 && ( -