JSFiddle - React, Tailwind, and code Playground
JavaScript
$(function() {
$('input').blur(function() {
var input = this[0];
alert(this);
if (input.setSelectionRange) {
input.focus();
input.setSelectionRange(pos, pos);
}
else if (input.createTextRange) {
var range = input.createTextRange();
range.collapse(true);
range.moveEnd('character', pos);
range.moveStart('character', pos);
range.select();
}
else if(input.selectionStart){
input.focus();
input.selectionStart = pos;
input.selectionEnd = pos;
}
});
});