🎨 Palette: Add Keyboard Accessibility to File Drop Zone#59
🎨 Palette: Add Keyboard Accessibility to File Drop Zone#59
Conversation
- Added `tabindex="0"`, `role="button"`, and `aria-label` to the `#dropZone` element in `index.php`. - Added a `click` listener to the drop zone in `js/app.js` to trigger the hidden file input, while preventing infinite loops by ignoring clicks on the nested `<button>` or `<input>`. - Added a `keydown` listener to the drop zone in `js/app.js` to trigger the file input when `Enter` or `Space` is pressed, fulfilling the button role expectations. - Added a `.upload-area:focus-visible` rule in `css/style.css` to display a visible focus ring matching Bootstrap's native style. - Created `.Jules/palette.md` to document the critical learning about custom drop zone accessibility for future reference. Co-authored-by: Nawayisus <154715157+Nawayisus@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. |
💡 What: Added comprehensive keyboard accessibility and screen reader support to the custom file upload drop zone (
#dropZone).🎯 Why: Previously, the drop zone was a
<div>with only mouse drag-and-drop and a generic internal button. Users navigating via keyboard (Tab) couldn't focus the large target area itself, and pressing Enter/Space did nothing. This violates WCAG accessibility guidelines.📸 Before/After: The drop zone now visually highlights with a blue focus ring when navigated to via
Taband successfully opens the file picker onEnterorSpace.♿ Accessibility: Added
tabindex="0",role="button", and a descriptivearia-label. Added JavaScript logic to handle standard button keypresses and afocus-visibleCSS rule for visual indication. Documented this pattern in the.Jules/palette.mdjournal.PR created automatically by Jules for task 13951262397135799903 started by @Nawayisus