Git Product home page Git Product logo

Comments (8)

stabildev avatar stabildev commented on July 19, 2024

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

const { open } = useDropzone()

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

from quill.

Sahil-pvt avatar Sahil-pvt commented on July 19, 2024

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

from quill.

stabildev avatar stabildev commented on July 19, 2024

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.

from quill.

Sahil-pvt avatar Sahil-pvt commented on July 19, 2024

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!!

from quill.

stabildev avatar stabildev commented on July 19, 2024

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

from quill.

Sahil-pvt avatar Sahil-pvt commented on July 19, 2024

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

from quill.

inextdeve avatar inextdeve commented on July 19, 2024

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>

from quill.

vladamilanovic avatar vladamilanovic commented on July 19, 2024

Same problem. not working for me too.

  • Next.js v13.2.4,
  • react-dropzone v14.2.3

from quill.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.