Fix upload plugin build

The issue was due to the ref I was using
This commit is contained in:
cyril lopez 2018-02-26 11:39:50 +01:00
parent dc55cfb879
commit 2f84afc0c7
2 changed files with 4 additions and 10 deletions

View File

@ -30,7 +30,8 @@ class Li extends React.Component {
handleClick = (e) => { handleClick = (e) => {
e.preventDefault(); e.preventDefault();
this.refs.aTag.click(); const aTag = document.getElementById('aTag');
aTag.click();
} }
handleDelete = (e) => { handleDelete = (e) => {
@ -76,7 +77,7 @@ class Li extends React.Component {
return ( return (
<CopyToClipboard text={item.url} onCopy={() => this.setState({copied: true})}> <CopyToClipboard text={item.url} onCopy={() => this.setState({copied: true})}>
<li className={styles.liWrapper}> <li className={styles.liWrapper}>
<a href={item.url} target="_blank" style={{ display: 'none' }} ref="aTag">nothing</a> <a href={item.url} target="_blank" style={{ display: 'none' }} id="aTag">nothing</a>
<div className={styles.liContainer}> <div className={styles.liContainer}>
<div> <div>
<div /> <div />

View File

@ -16,12 +16,6 @@ import styles from './styles.scss';
class PluginInputFile extends React.PureComponent { class PluginInputFile extends React.PureComponent {
state = { isDraging: false }; state = { isDraging: false };
handleClick = (e) => {
e.preventDefault();
e.stopPropagation();
this.refs.input.click();
}
handleDragEnter = () => this.setState({ isDraging: true }); handleDragEnter = () => this.setState({ isDraging: true });
handleDragLeave = () => this.setState({ isDraging: false }); handleDragLeave = () => this.setState({ isDraging: false });
@ -40,7 +34,7 @@ class PluginInputFile extends React.PureComponent {
const { isDraging } = this.state; const { isDraging } = this.state;
const link = ( const link = (
<FormattedMessage id="upload.PluginInputFile.link"> <FormattedMessage id="upload.PluginInputFile.link">
{(message) => <span className={styles.underline} onClick={this.handleClick}>{message}</span>} {(message) => <span className={styles.underline}>{message}</span>}
</FormattedMessage> </FormattedMessage>
); );
@ -65,7 +59,6 @@ class PluginInputFile extends React.PureComponent {
multiple multiple
name={name} name={name}
onChange={onChange} onChange={onChange}
ref="input"
type="file" type="file"
/> />
</label> </label>