[Webkit-unassigned] [Bug 236937] New: Keyboard autocorrect (spellcheck) buffer is not reset when clearing text field value

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Feb 20 01:45:25 PST 2022


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

            Bug ID: 236937
           Summary: Keyboard autocorrect (spellcheck) buffer is not reset
                    when clearing text field value
           Product: WebKit
           Version: Safari 15
          Hardware: iPhone / iPad
                OS: iOS 15
            Status: NEW
          Severity: Major
          Priority: P2
         Component: New Bugs
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: teodor.atroshenko at gmail.com

Here are a couple of issues from Stack Overflow:
https://stackoverflow.com/questions/18689842/clearing-input-element-in-mobile-safari-with-javascript-does-not-clear-the-ios-a
https://stackoverflow.com/questions/46425476/ios-html-autocorrect-save-previous-value-after-programmaticaly-textarea-clean

And a reproduction case (first field works, second field does not):
https://jsbin.com/zusahev

This is a typical scenario of a text chat:
1. User types in some text, e.g. "Hello"
2. The autocorrect buffer (leftmost box immediately above the keyboard) now says "Hello"
3. User taps on "Send" button, which in turn has a touchstart and/or touchend handler that calls event.preventDefault() to stop the virtual keyboard from closing
4. User types in some more text, e.g. "wolrd" (note: that the word is no longer auto capitalized due to the same issue - it thinks we are still typing in the word from the previous chat message)
5. The autocorrect buffer now says "Hellowolrd", all sensible suggestions disappear
6. User taps on "Send" button
7. User enters another word without any spaces, the buffer appends that word, and so on

I believe this is only visible in WKWebView right now, but I may be wrong. What I mean by this is that the buffer contents are displayed only in WKWebView. Users of Safari will only see the lack of auto capitalization after the first chat message is sent. So if you want to make sure this is actually happening in Safari using jsbin link above, then you can type in just one word (notice how it autocapitalizes) in the second textarea, then hit Button 2, and then type in another word (notice how it does not autocapitalize).

There are multiple things at play here:
1. WKWebView always displays "misspelled words" area above keyboard bug #225092
2. Inability to programmatically reset the spellcheck state bug #48411
3. Change to input value does not trigger spellcheck bug #139473

If 3 is fixed, then everything will just start working (at least that's the expectation).

If 2 is fixed, then developers can add a workaround, where they momentarily disable spellcheck after "reading" the value of the input (re-enabling it after a short delay).

If 1 is fixed, at least we can hide the broken autocorrect buffer from users. This is especially important in apps using WKWebView, as for all practical purposes the user would assume this is a bug in the app and not in Safari.

-- 
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/20220220/838c3fb5/attachment.htm>


More information about the webkit-unassigned mailing list