question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

axe should be aware of input type default of text

See original GitHub issue

regarding input type…

If this attribute is not specified, the default type adopted is text.

_from https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input_

example markup:

<input ng-repeat="input in inputCtrl" ng-style="{'width': input.css + '%'}" class="input-md _1DEW order-number landing-input-1 sidebar-input-number ng-touched" ng-class="{ 'input-error': $ctrl.showError }" type="input.type" aria-label="Order Number" aria-describedby="loginErrorTooltip" data-test="input-number" placeholder="" ng-required="input.is_required" ng-model="$ctrl.modelObject[input.name]" ng-change="$ctrl.updateLandingForm(input.name, $ctrl.modelObject[input.name])" style="width: 98%;">

(from https://returns.narvar.com/reionline/returns)

Expectation: getRole(document.querySelector('input')) should return textbox

Actual: getRole(document.querySelector('input')) returns null

I can tell this is because the above input, has an invalid type of input.type 🤦 but it appears that all browsers treat that invalid type attribute value as the same as not having it present at all (which defaults to text). I’ve tested this rei page out with safari + vo and inspected a11y trees in the 3 major browsers.

Motivation: 🤷


axe-core version:4.0.2


Browser and Assistive Technology versions


For Tooling issues:
- Node version: XX  
- Platform:  

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
shankarshastricommented, Oct 3, 2020

@straker , I can take a look at this one !!

1reaction
strakercommented, Sep 10, 2020

Should be an easy fix. Instead of looking at the type attribute as we do now, we should look at the vNode.props.type property which is already calculated to respect valid types and default to text

Read more comments on GitHub >

github_iconTop Results From Across the Web

Form <input> elements must have labels | Axe Rules
Form elements that should have labels · Text entry fields, e.g. <input type="text"> , <input type="password"> and <textarea> · Radio buttons, <input type="radio"> ......
Read more >
will input default to a type of text?
"text" is the default if you don't specify anything (developer.mozilla.org/en/docs/Web/HTML/Element/Input). I'm not sure if there is behaviour defined if you ...
Read more >
Axe API Documentation
This section gives a quick description of how to use the axe APIs to analyze web page content and return a JSON object...
Read more >
Autocomplete attribute has valid value | ACT Rule | WAI
This rule applies to any HTML input , select and textarea element with an autocomplete attribute value that is neither empty ( ""...
Read more >
Create UI axes for plots in apps - MATLAB uiaxes
Thus, you can pass a UIAxes object to most functions that accept an Axes object. ... [0 1] (default) | two-element vector of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found