Commit 62669fb0 authored by Matija Obreza's avatar Matija Obreza
Browse files

Don't autodetect CSV settings on paste event

parent 53291234
......@@ -376,7 +376,7 @@
console.log('Not enough data for auto-detection len=', area.value.length);
return;
}
var lines = area.value.replace(/\r\n/g, "\n").split("\n");
var lines = area.value.substr(0, 5000).replace(/\r\n/g, "\n").split("\n");
var separator = CSVAutodetector.detectSeparator(lines);
var quote = CSVAutodetector.detectQuoteChar(lines, separator);
var escape = CSVAutodetector.detectEscapeChar(lines, separator, quote);
......@@ -385,7 +385,8 @@
CSVAutodetector.autoSelectOptions(separator, quote, escape, decimalMark);
};
document.getElementById("autodetectCsv").addEventListener("click", autodetectSettings);
document.getElementById("csvText").addEventListener("paste", function(e) { setTimeout(autodetectSettings, 10); });
// Do NOT autodetect CSV on paste!
// document.getElementById("csvText").addEventListener("paste", function(e) { setTimeout(autodetectSettings, 10); });
});
</script>
</body>
......
Supports Markdown
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