Premature aria-invalid

This test case shows an invalid and premature application of the aria-invalid attribute on the input field by the dijit ValidationTextBox. Run JAWS and click inside the input field. JAWS reads the input as required and invalid even before any data has been entered.

by amiramix

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.8/dijit/themes/claro/claro.css">
<body class="claro">

    <form id="myForm" data-dojo-type="dijit/form/Form" encType="multipart/form-data" action="#" method="post">
        <label for="zip">Also 5-Digit U.S. Zipcode only:</label>
        <input type="text" name="zip" data-dojo-type="dijit/form/ValidationTextBox" data-dojo-props="regExp:'\\d{5}', invalidMessage:'Invalid zip code.', required: true" />

        <button id="submitBtn" type="submit" data-dojo-type="dijit/form/Button">Submit</button>
    </form>

    <script>
    require(["dojo/parser", "dijit/form/ValidationTextBox"]);
    </script>

</body>