Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding file using "Browse Files" button is not working #228

Open
Mahmaddz opened this issue Jun 2, 2024 · 2 comments
Open

Adding file using "Browse Files" button is not working #228

Mahmaddz opened this issue Jun 2, 2024 · 2 comments

Comments

@Mahmaddz
Copy link

Mahmaddz commented Jun 2, 2024

I used a React component with a modal. When I click on the "Browse Files" button, it doesn't load the file or work properly.
How to recreate: Just install library in your project and then use the example code provided on docs.

versions:
csv-import-react: ^1.0.11
react: ^18.3.1

Component code:
`import { useState } from "react";
import { CSVImporter } from "csv-import-react";

const CsvImportComponent: React.FC = () => {
const [isOpen, setIsOpen] = useState(false);

return (
<>
<button onClick={() => setIsOpen(true)}>Open CSV Importer

  <CSVImporter
    modalIsOpen={isOpen}
    isModal={true}
    modalOnCloseTriggered={() => setIsOpen(false)}
    // darkMode={true}
    onComplete={(data) => console.log(data)}
    template={{
      columns: [
        {
          name: "First Name",
          key: "first_name",
          required: true,
          description: "The first name of the user",
          suggested_mappings: ["First", "Name"],
        },
        {
          name: "Age",
          data_type: "number",
        },
      ],
    }}
  />
</>

);
};

export default CsvImportComponent;`

When i use browse files button it doesnt work. Only drag functionality if working
SudeepLogisticsPvtLtd-ezgif com-video-to-gif-converter
SudeepLogisticsPvtLtd-ezgif com-video-to-gif-converter (1)

@ansario
Copy link

ansario commented Aug 27, 2024

@Mahmaddz did you figure this out?

@Mahmaddz
Copy link
Author

@Mahmaddz did you figure this out?

no, i switched to another library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants