csv-import icon indicating copy to clipboard operation
csv-import copied to clipboard

Adding file using "Browse Files" button is not working

Open Mahmaddz opened this issue 8 months ago • 2 comments

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)

Mahmaddz avatar Jun 02 '24 16:06 Mahmaddz