JSFiddle - React, Tailwind, and code Playground

by Trisox

HTML

<input type="text" class="email"/>

CSS

input{width:300px;}

JavaScript

$(document).ready(function() {
    $('input.email').on('keyup blur', function(event) {
        if (event.which >= 37 && event.which <= 40) {
            event.preventDefault();
        }
        var $this = $(this);
        var email = $this.val().replace(" ", ",");
        $this.val(email);
    });
});