Correctly display an item which is too long for the textfield. (#13477)

New JSNI function allows direction parameter in setSelectionRange.
This allows setting selection backward and fixes the issue in FF.

Change-Id: I1e34b70983e3f525b7009668877038f108d286a7