Skip to content

Commit

Permalink
Added for={inputId} to label option. (#4)
Browse files Browse the repository at this point in the history
This let's users style their label as opposed to their input directly.
  • Loading branch information
Elgin Beloy authored and nzambello committed Jun 18, 2018
1 parent 8bd883d commit 1a23179
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const CSVReader = ({ cssClass = 'csv-reader-input', label, onFileLoaded, onError

return (
<div className={cssClass}>
{label && <label>{label}</label>}
{label && <label for={inputId}>{label}</label>}
<input className="csv-input" type="file" id={inputId} accept="text/csv" onChange={e => handleChangeFile(e)} />
</div>
);
Expand All @@ -35,4 +35,4 @@ CSVReader.propTypes = {
inputId: string
};

export default CSVReader;
export default CSVReader;

0 comments on commit 1a23179

Please sign in to comment.