Commit 8e2a3934 authored by Matija Obreza's avatar Matija Obreza

GG D&D

parent e8ddf390
......@@ -60,14 +60,26 @@ class ListOfAccession extends React.Component<IListOfAccession, any> {
public dataPasted = (e) => {
e.preventDefault();
console.log('Pasted', e.clipboardData.types);
this.setState({ ...this.state, uploading: true, uploadText: 'Parsing' });
console.log('Pasted', e.clipboardData);
// Delay parsing a little bit for UI to update
const data = e.clipboardData.getData('text/plain');
setTimeout(() => this.parseCsv(data), 10);
}
public dataDropped = (e) => {
e.preventDefault();
console.log('Dropped types', e.dataTransfer.types);
this.setState({ ...this.state, uploading: true, uploadText: 'Parsing' });
// Delay parsing a little bit for UI to update
const data = e.dataTransfer.getData('text/plain');
console.log('Dropped data', data);
console.log('Dropped data', e.dataTransfer.getData('text/html'));
setTimeout(() => this.parseCsv(data), 10);
}
public textBlurred = (e) => {
if (this.state.uploading) {
return;
......@@ -145,7 +157,7 @@ class ListOfAccession extends React.Component<IListOfAccession, any> {
<form>
<FormControl fullWidth>
<InputLabel>{ t('subsets.dashboard.p.stepper.accessionList.listOfAccessions') }</InputLabel>
<Input multiline placeholder={ t('subsets.dashboard.p.stepper.accessionList.pasteData') } onPaste={ this.dataPasted } onBlur={ this.textBlurred }/>
<Input multiline placeholder={ t('subsets.dashboard.p.stepper.accessionList.pasteData') } onPaste={ this.dataPasted } onDrop={ this.dataDropped } onBlur={ this.textBlurred }/>
</FormControl>
</form>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment