[Webkit-unassigned] [Bug 220430] New: autocapitalize does not work correctly after clearing input value

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 7 12:25:44 PST 2021


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

            Bug ID: 220430
           Summary: autocapitalize does not work correctly after clearing
                    input value
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: iPhone / iPad
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Forms
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: ldebeasi at gmail.com
                CC: cdumez at apple.com, wenson_hsieh at apple.com

Created attachment 417199

  --> https://bugs.webkit.org/attachment.cgi?id=417199&action=review

Code Reproduction

When clearing an input programmatically, the autocapitalize attribute no longer works as expected.

Steps to reproduce:

1. Open attached code reproduction on an iOS device.
2. Type "test" into the input. It should be rendered as "Test" because autocapitalize is enabled.
3. Tap the "Clear Input" button. The value of the input should be set to the empty string, and the input should remain focused.
4. Type "test" into the input. It should be rendered as "test" this time.

If you have predictive text enabled on your iOS device, you should notice that the first suggestion on the left is "Testtest". This leads me to believe that iOS is not updating some internal state for the input when programmatically clearing.

Expected Behavior:

After clearing the input the first time, I would expect that typing "test" would get rendered out as "Test" due to the autocapitalize attribute.

Actual Behavior:

Typing "test" is rendered out as "test".


Other info:

* I can reproduce this on iOS 13 and iOS 14.
* This works as expected on Chrome for Android.
* A common use case for this is when users want to clear an input without closing the keyboard. In the example I attached, the clear button has a "touchstart" listener that a) clears the input value and b) calls event.preventDefault so the keyboard does not get closed.

-- 
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/20210107/524fb94e/attachment.htm>


More information about the webkit-unassigned mailing list