tableflowhq / csv-import

The open-source CSV importer, maintained by @tableflowhq
https://tableflow.com
MIT License
1.68k stars 99 forks source link

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

Open Mahmaddz opened 3 months ago

Mahmaddz commented 3 months ago

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 commented 3 weeks ago

@Mahmaddz did you figure this out?

Mahmaddz commented 3 days ago

@Mahmaddz did you figure this out?

no, i switched to another library