Skip to content

Commit

Permalink
feat: Add name attribute to file input
Browse files Browse the repository at this point in the history
  • Loading branch information
mahesh-krishnakumar authored and nzambello committed Feb 10, 2021
1 parent 859860d commit 24866bf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface CSVReaderProps {
cssLabelClass?: string
fileEncoding?: string
inputId?: string
inputName?: string
inputStyle?: object
label?: string | React.ReactNode
onError?: (error: Error) => void
Expand All @@ -30,6 +31,7 @@ const CSVReader: React.FC<CSVReaderProps> = ({
cssLabelClass = 'csv-label',
fileEncoding = 'UTF-8',
inputId = 'react-csv-reader-input',
inputName= 'react-csv-reader-input',
inputStyle = {},
label,
onError,
Expand Down Expand Up @@ -69,6 +71,7 @@ const CSVReader: React.FC<CSVReaderProps> = ({
className={cssInputClass}
type="file"
id={inputId}
name={inputName}
style={inputStyle}
accept={accept}
onChange={e => handleChangeFile(e)}
Expand All @@ -85,6 +88,7 @@ CSVReader.propTypes = {
cssLabelClass: PropTypes.string,
fileEncoding: PropTypes.string,
inputId: PropTypes.string,
inputName: PropTypes.string,
inputStyle: PropTypes.object,
label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
onError: PropTypes.func,
Expand Down

0 comments on commit 24866bf

Please sign in to comment.