0

I want to set position of the cursor at end of the text. I can do that, no issues there. Problem is in mozilla. It works fine for short text. In case of long text I don't know if the cursor is being placed at the end or not. Let's assume it does cuz it works fine for short text. On google chrome if there is long text the cursor is placed at the end when onFocus is called and text sort of scrolls towards left so that end of the text is visible with the cursor.

Now, that scrolling thing should happen on mozilla but it doesn't. I need help.

Mozilla example:

mozilla example

Google chrome example: chrome example

Kushal
  • 8,100
  • 9
  • 63
  • 82
Prabh Jot
  • 29
  • 7

1 Answers1

0

You have to trigger onfoucs callback
If you use jQuery

$('input[type=text]').focus(function() {
    var e = $.Event('keydown', { keyCode: 39 }); // right arrow key
    $(this).trigger(e);
});

reference: Auto arrow (right) key press event?

seunggabi
  • 1,699
  • 12
  • 12