JSFiddle - React, Tailwind, and code Playground
HTML
<input id="longInput" dir="rtl" value="http://stackoverflow.com/questions/1962168/scroll-to-the-very-right-of-a-long-text-input">
JavaScript
$("#longInput").focus(function () {
$(this).attr('dir', 'ltr');
});
$("#longInput").blur(function () {
$(this).attr('dir', 'rtl');
});