added onInputFileHandler
This commit is contained in:
parent
8fd658ced9
commit
5bf6f7de50
@ -384,6 +384,8 @@ class Body extends Component {
|
||||
onContinueHandler = () => {
|
||||
const valid = this.checkingValid();
|
||||
|
||||
console.log(this.state.file)
|
||||
|
||||
if (valid) {
|
||||
const { setPortalOwner, wizardToken } = this.props;
|
||||
const { password, email,
|
||||
@ -453,6 +455,12 @@ class Body extends Component {
|
||||
}});
|
||||
}
|
||||
|
||||
onInputFileHandler = file => {
|
||||
this.setState({
|
||||
file: file
|
||||
})
|
||||
}
|
||||
|
||||
renderModalDialog = () => {
|
||||
const { errorLoading, visibleModal, errorMessage } = this.state;
|
||||
const { t, isOwner, ownerEmail } = this.props;
|
||||
@ -547,9 +555,7 @@ class Body extends Component {
|
||||
placeholder={t('placeholderLicense')}
|
||||
size="large"
|
||||
scale={true}
|
||||
onInput={(file) => {
|
||||
console.log(`name: ${file.name}`, `lastModified: ${file.lastModifiedDate}`, `size: ${file.size}`);
|
||||
}}
|
||||
onInput={this.onInputFileHandler}
|
||||
/>
|
||||
</Box>
|
||||
: null;
|
||||
|
@ -87,7 +87,8 @@ class FileInput extends Component {
|
||||
this.inputRef = React.createRef();
|
||||
|
||||
this.state = {
|
||||
fileName: ''
|
||||
fileName: '',
|
||||
file: null
|
||||
}
|
||||
}
|
||||
|
||||
@ -116,13 +117,13 @@ class FileInput extends Component {
|
||||
|
||||
if ( this.inputRef.current.files.length > 0 ) {
|
||||
this.setState({
|
||||
fileName: this.inputRef.current.files[0].name
|
||||
fileName: this.inputRef.current.files[0].name,
|
||||
file: this.inputRef.current.files[0]
|
||||
}, () => {
|
||||
if(onInput) onInput(this.state.file);
|
||||
});
|
||||
|
||||
if(onInput) onInput(this.inputRef.current.files[0]);
|
||||
} else {
|
||||
this.setState({ fileName: '' })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
|
Loading…
Reference in New Issue
Block a user