ARIA in HTML - test case for aria-required

last updated 14 March 2021

The required attribute is allowed on input, select and textarea.

Tests:

Test 1

Authors MAY use the aria-required attribute on any element that is allowed the required attribute in HTML, or any element with a WAI-ARIA role which allows the aria-required attribute.

The following testcase sets aria-required on each element which allows the required attribute in HTML. The required attribute is only allowed on inputs with type of checkbox, date, datetime-local, email, file, month, number, password, radio, search, tel, text, time, url, or week.

Expected result:
No warning or error for use of aria-required on these elements.

Test 2

Authors SHOULD NOT use the aria-required="true" on any element which also has a required attribute.

Expected result:
Conformance checkers should warn authors about not using both attributes

Test 3

Authors MUST NOT use the aria-required="false" on any element which also has a required attribute.

Expected result:
Conformance checkers should indicate an error for use of these attributes with opposite values