Fix Dataframe whole-table keyboard focus - #13633
Draft
abidlabs wants to merge 1 commit into
Draft
Conversation
Collaborator
🪼 branch checks and previews
Install Gradio from this PR pip install https://huggingface.co/buckets/gradio/pypi-previews/resolve/0dd91c133b4325112e265bb0625be5c11d458f8f/gradio-6.20.0-py3-none-any.whlInstall Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@0dd91c133b4325112e265bb0625be5c11d458f8f#subdirectory=client/python"Import Gradio JS Client from this PR via CDN import { Client } from "https://huggingface.co/buckets/gradio/npm-previews/resolve/0dd91c133b4325112e265bb0625be5c11d458f8f/browser.js"; |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves keyboard accessibility of the Dataframe component by removing whole-table “grid container” elements (and the Dataframe upload wrapper) from the normal Tab sequence, while keeping programmatic focus and individual cell focus intact. It also adds regression coverage to ensure the intended focus targets remain correct.
Changes:
- Make the Dataframe grid container(s) non-tabbable by changing the grid wrapper’s
tabindexto-1. - Prevent
Uploadinstances withdisable_clickfrom becoming Tab stops by settingtabindex=-1in that state. - Add/extend Dataframe unit tests to assert expected tabIndex/tabindex values for the grid containers, upload drop target, and an individual cell.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| js/upload/src/Upload.svelte | Removes Upload from the Tab sequence when disable_click is enabled. |
| js/dataframe/shared/Table.svelte | Removes the grid wrapper from the Tab sequence (tabindex=-1) to avoid whole-table focus stops. |
| js/dataframe/Dataframe.test.ts | Adds regression assertions for focus/tabIndex targets and shared-prop coverage setup. |
| .changeset/fuzzy-tables-focus.md | Records a patch-level change for the affected packages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| describe("Dataframe rendering", () => { | ||
| afterEach(() => cleanup()); | ||
|
|
||
| test("tabbing skips dataframe containers and reaches individual cells", async () => { |
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
This removes the Dataframe's whole-table containers from the normal keyboard Tab sequence while preserving programmatic grid focus and individual cell focus. It also prevents the disabled-click upload wrapper used by Dataframe from becoming a separate Tab stop and adds regression coverage for the resulting focus targets.
Closes: #11735
AI Disclosure
🎯 PRs Should Target Issues
This PR targets #11735. I checked open PRs by issue number and focus-related wording before opening this PR and found no overlapping work.
Testing and Formatting Your Code
CI=1 npx vitest run --config .config/vitest.config.ts js/dataframe/Dataframe.test.ts— 51 passed, 2 todo.pnpm build— passed.bash scripts/format_frontend.sh— formatting completed; the repository-widesvelte-checkstep reported 15 errors outside the touched files (existing utility, Prism declaration, and preview/Rollup typing errors).tabIndex = -1, while the individualAlicecell remains attabIndex = 0.The reproduction demo was kept untracked and is not part of this PR: