[Webkit-unassigned] [Bug 244976] New: Textarea selection does not return the caret position on focus event

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 9 07:03:18 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=244976

            Bug ID: 244976
           Summary: Textarea selection does not return the caret position
                    on focus event
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Forms
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: zlip.792 at gmail.com
                CC: cdumez at apple.com, wenson_hsieh at apple.com

Hi Team,

Another dumpster dive in Chromium Monorail to find any test case broken in Safari / Webkit and I came across following:

Test Case - https://jsfiddle.net/2s64xjve/

----

<textarea id="text"></textarea>
<button onclick="document.getElementById('text').focus();">Focus</button>
<script>
  var textarea = document.getElementById('text');
  textarea.addEventListener('focus', function (e) {
    console.log(textarea.selectionStart);
  });
</script>


----

Chrome Bug Link - https://crbug.com/526516

*** STEPS TO REPRODUCE ***

1) Go to JSFiddle
2) Type something in the field
3) Place your cursor in the middle or somewhere in the text and click on "Focus"

<<< ACTUAL RESULT >>>

Returns 0

<<< EXPECTED RESULT >>>

Show the caret position or character where our IBEAM cursor is.

^^^ OTHER BROWSERS ^^^

Chrome Canary 107 - shows position of IBEAM
Firefox Nightly 106 - shows position of IBEAM
Safari Technology Preview 152 - shows "Actual Result"

_____

Matching other browsers would be great and why not another chance to make Webkit better.

Thanks!

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220909/31030151/attachment.htm>


More information about the webkit-unassigned mailing list