Skip to content

🎨 Palette: Add Keyboard Accessibility to File Drop Zone#59

Draft
Nawayisus wants to merge 1 commit intomainfrom
palette/a11y-dropzone-keyboard-13951262397135799903
Draft

🎨 Palette: Add Keyboard Accessibility to File Drop Zone#59
Nawayisus wants to merge 1 commit intomainfrom
palette/a11y-dropzone-keyboard-13951262397135799903

Conversation

@Nawayisus
Copy link
Copy Markdown
Owner

💡 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 Tab and successfully opens the file picker on Enter or Space.
Accessibility: Added tabindex="0", role="button", and a descriptive aria-label. Added JavaScript logic to handle standard button keypresses and a focus-visible CSS rule for visual indication. Documented this pattern in the .Jules/palette.md journal.


PR created automatically by Jules for task 13951262397135799903 started by @Nawayisus

- 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>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant