WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Clear text within search edit field

for

From: Joshua Hori
Date: Sep 14, 2024 12:48PM


I was also a bit confused by this. If your "clear all" button relies on data being entered into the search element, it could be failing the 2.4.7 Focus Visible and 3.2.2 On Input criteria. While many are focusing on 2.1.1 (Keyboard), it's worth noting that specific keystrokes aren’t required to activate the "clear all" button.

What stands out to me is 2.4.7 Focus Visible, especially for users with mobility impairments. They would need to press more buttons to remove accidentally pasted content, instead of being able to access the "clear all" button directly. There have been several instances where the "select all" function included the entire webpage content, not just the form field, which can be frustrating.

Regarding 3.2.1 On Focus and 3.2.2 On Input, when the search button is activated, a "clear all" button becomes available after content is entered. Although the page doesn’t change when the search receives focus, it does when input is entered. If there are clear instructions on the page indicating this, such as adding ARIA instructions to the search field or an ARIA-live region that announces “clear search field content,” it might prevent the failure of these criteria.

It can be overwhelming when keyboard shortcuts are inconsistent, and sometimes you just want to quickly tab and enter to clear content, similar to how a mouse user would perform a simple two-step process (slide and click).

Best,

Joshua

From: WebAIM-Forum < <EMAIL REMOVED> > on behalf of <EMAIL REMOVED> < <EMAIL REMOVED> >
Date: Saturday, September 14, 2024 at 8:39 AM
To: WebAIM Discussion List < <EMAIL REMOVED> >
Subject: Re: [WebAIM] Clear text within search edit field
I’m a little confused with all that I am hearing about this issue.
If there is a search field that has a clear content button and there’s nothing entered into the search field. I do not expect that button to be focusable.
I’ve seen many forms that have a submit form button, that are dimmed until information is entered into the form and then it is focusable, so what’s the actual situation?
Dean Vasile


617-799-1162

> On Sep 14, 2024, at 11:22 AM, Patrick H. Lauke < <EMAIL REMOVED> > wrote:
>
> 
>
>> On 14/09/2024 15:24, Barry via WebAIM-Forum wrote:
>> Even though there is an alternative method for achieving the same functionality (e.g., selecting the text in the edit field and using backspace or delete), this approach may still fail WCAG 2.1.1 (Keyboard Navigation) for the following reasons:
>
> None of the reasons provided are normative parts of the success criterion, so I'm afraid not.
>
> P
> --
> Patrick H. Lauke
>
> * https://www.splintered.co.uk/
> * https://github.com/patrickhlauke
> * https://flickr.com/photos/redux/
> * https://mastodon.social/@patrick_h_lauke
>
> > > >