Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Cursor Position in TextAreaItem

    Tested on https://www.smartclient.com/smartgwt...d_complete_app Version 12.0p Built 2019-07-22

    When tab to edit the Description, the cursor will be at the start of the text with Safari on Mac, while the cursor will be at the end of the text with Chrome.

    Click image for larger version

Name:	Safari.jpg
Views:	210
Size:	199.9 KB
ID:	258777
    Safari

    Click image for larger version

Name:	Chrome.jpg
Views:	168
Size:	170.7 KB
ID:	258778
    Chrome

    Any suggestion how I can make the cursor and the text display from the start of the text for Chrome, just like Safari?

    With setSelectionRange(0,0); I can position the cursor to the front of the text. However, if the text is more than the text box length (vertical scroll bar appear), with Chrome, even though the cursor is set to the start of the text, the text box still display the text to the end (the cursor will be out of the display range above the text displayed).

    Thank you very much for your help!

    #2
    This appears to be just a browser idiosyncrasy, and so far as we know, there is no standard applicable to this, so neither browser can be considered to be wrong here.

    setSelectionRange() is what we would have suggested to make the placement consistent if that's critical to you. The fact that Chrome doesn't scroll to the top when you setSelectionRange() is definitely a Chrome bug (it's not valid from an accessibility perspective to have the cursor offscreen), so you could file a bug with Chrome for that, or see if one is already filed and "star" it.

    Comment


      #3
      OK. Thank you very much or your information.

      Comment

      Working...
      X