JSFiddle - React, Tailwind, and code Playground
HTML
<html>
<head>
</head>
<body>
<input type="text" />
<div></div>
</body>
</html>
JavaScript
$(function(){
$('input').on('paste', function(e){
var target = $(e.target);
var textArea = $("<textarea></textarea>");
textArea.bind("blur", function(e) {
target.val(textArea.val().replace(/\r?\n/g, ', ') );
textArea.remove();
});
$("body").append(textArea);
textArea.focus();
setTimeout(function(){
target.focus();
}, 10);
});
});