π¨ Palette: Add accessible clear buttons to search inputs#91
Conversation
- Added accessible 'clear' buttons (X icon) to custom search/filter inputs in `ProjectsApp`, `BlogApp`, and `Launcher`. - Utilized `useRef` to maintain keyboard focus context when clearing, preventing users from losing their place in the DOM. - Kept inputs strictly accessible with `type="button"`, explicit `aria-label`, and `focus-visible` utilities. - Added a UX/a11y journal entry to `.Jules/palette.md` to document this focus management pattern. Co-authored-by: schmug <38227427+schmug@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
π¨ Palette: Add Accessible Clear Buttons to Search Inputs
π‘ What:
Added a "clear" button (an 'X' icon) to the custom search and filter input fields within the
ProjectsApp,BlogApp, andLaunchercomponents. The button only appears when there is text to clear.π― Why:
Custom search and filter inputs that use
outline-noneoften break native browser accessibility features, like the native clear button. By adding a custom clear button, we make it easier to reset searches. More importantly, simply adding a button isn't enough; we implemented it using auseRefso that when the button is clicked, keyboard focus is immediately returned to the input field. This prevents users who navigate via keyboard from losing their context and having to tab through the DOM again.βΏ Accessibility:
type="button"to avoid accidentally submitting parent forms.aria-label="Clear filter"for screen readers.focus-visibleutility classes to the button to ensure it is easily reachable and distinguishable via keyboard navigation..Jules/palette.md.PR created automatically by Jules for task 1689024892557736545 started by @schmug