WkWebView: When using autocomplete for username/password, JavaScript event “keyup” is not triggered

I created a login webpage that disables the "Login" button as long as user name and password have not been filled in yet:

<script type="text/javascript" language="javascript">
    function checkform()
    {
        var f = document.forms["theform"].elements;
        var cansubmit = true;

        for (var i = 0; i < f.length; i++) {
            if (f[i].value.length == 0) cansubmit = false;
        }

        document.getElementById('submitbutton').disabled = !cansubmit;
    }
</script> 
<form name="theform">
<input id="user-text-field" type="text" type="email" autocomplete="username" onKeyup="checkform()" />
<input id="password-text-field" type="password" autocomplete="current-password" onKeyup="checkform()" />
<input id="submitbutton" type="submit" disabled="disabled" value="Login" />
</form>

I use an WkWebView to display the page. It works fine when manually entering user name or password. However, if I use the autocomplete function of iOS to fill in user name and password, the "Login" button stays disabled.

It looks like in case of autocomplete, the keyup event is not generated. In Safari, it works correctly.

Is this an iOS bug? Any way to work around it?

WkWebView: When using autocomplete for username/password, JavaScript event “keyup” is not triggered
 
 
Q