joschan21 / quill

Quill - A Modern SaaS-Platform Built With Next.js 13
1.88k stars 500 forks source link

File upload does not work for small devices (Mobile) #38

Open Sahil-pvt opened 11 months ago

Sahil-pvt commented 11 months ago

After selecting a file, the upload process should start, but it isn't working.

https://github.com/joschan21/quill/assets/129893605/c964cd53-8555-4f60-a52d-4d2c359b751b

stabildev commented 10 months ago

Solution: https://github.com/react-dropzone/react-dropzone/issues/1196#issuecomment-1409949458

const { open } = useDropzone()

return (
  ...
  <Dropzone
      noClick={true}
      ...
  >
      {({ getRootProps, getInputProps, acceptedFiles }) => (
        <div
          onClick={open}
          ...
Sahil-pvt commented 10 months ago

Solution: react-dropzone/react-dropzone#1196 (comment)

const { open } = useDropzone()

return (
  ...
  <Dropzone
      noClick={true}
      ...
  >
      {({ getRootProps, getInputProps, acceptedFiles }) => (
        <div
          onClick={open}
          ...

It works in localhost but not in deployed version Check this:- https://github.com/Sahil-pvt/PDFAskMate/blob/master/src/components/UploadButton.tsx

image

stabildev commented 10 months ago

You have to destructure open from the useDropzone hook:

import Dropzone, { useDropzone } from 'react-dropzone'
...
const { open } = useDropzone()

You're passing in open as a prop from the dialog which is false.

Can confirm that it 100% works on iPhone.

Sahil-pvt commented 10 months ago

You have to destructure open from the useDropzone hook:

import Dropzone, { useDropzone } from 'react-dropzone'
...
const { open } = useDropzone()

You're passing in open as a prop from the dialog which is false.

Can confirm that it 100% works on iPhone.

Again same problem!!

stabildev commented 10 months ago

You have to destructure open from the useDropzone hook:

import Dropzone, { useDropzone } from 'react-dropzone'
...
const { open } = useDropzone()

You're passing in open as a prop from the dialog which is false. Can confirm that it 100% works on iPhone.

Again same problem!!

https://gist.github.com/stabildev/6cb5651db2f97274a6ce8f6355679648

Sahil-pvt commented 10 months ago

You have to destructure open from the useDropzone hook:

import Dropzone, { useDropzone } from 'react-dropzone'
...
const { open } = useDropzone()

You're passing in open as a prop from the dialog which is false. Can confirm that it 100% works on iPhone.

Again same problem!!

https://gist.github.com/stabildev/6cb5651db2f97274a6ce8f6355679648

Still not working 🙃, btw thanks for this

inextdeve commented 9 months ago

im faced the same problem and this code is work properly with me:

import { useDropzone } from "react-dropzone";
....
const { acceptedFiles, getRootProps, getInputProps } = useDropzone({
    multiple: false,
    accept: { "application/pdf": [] },
    noClick: isUploading,
    onDrop: async (acceptedFile) => {
      //put onDrop func logic
    },
  });
  return <div
      {...getRootProps()}
      className="border h-64 m-4 border-dashed border-gray-300 rounded-lg"
    >
    .....
    <input {...getInputProps()} className="hidden" />
   </div>
vladamilanovic commented 6 months ago

Same problem. not working for me too.