searchinput element does not have a name available to an accessibility API
-
Using the HTML_CodeSniffer tool I pick up this error on both a site I’m working on and the website for this plugin:
This searchinput element does not have a name available to an accessibility API. Valid names are: label element, title undefined, aria-label undefined, aria-labelledby undefined.
When I look at the code in the plugin I notice it has this in include/forms.php,
$form .= sprintf( '<meta itemprop="target" content="%s"/><label for="%s">%s</label><input itemprop="query-input" type="search" name="s" id="%s" %s="%s" /><input type="submit" value="%s" /></form>',
however it is not printed in the source when I’m testing on the frontend, it looks like:
<form class="search-form" itemprop="potentialAction" itemscope="" itemtype="https://schema.org/SearchAction" method="get" action="https://website.org/" role="search"><input class="search-form-input" type="search" name="s" id="searchform-5c0f6bb3a0a533.88678965" placeholder="Search"><input class="search-form-submit" type="submit" value="Search"><meta itemprop="target" content="https://website.org/?s={s}"></form>
Any thoughts on what might be going on there? I would think this is a false positive but I also notice no label elements in the markup. Thank you!
- The topic ‘searchinput element does not have a name available to an accessibility API’ is closed to new replies.