Skip to content

feat: File panel input/upload button autofocus (BLO-1220) - #3220

Open
matthewlipski wants to merge 5 commits into
a11y-testingfrom
file-panel-focus
Open

matthewlipski wants to merge 5 commits into
a11y-testingfrom
file-panel-focus

Conversation

@matthewlipski

@matthewlipski matthewlipski commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This PR makes it so that the URL input and file upload button in the file panel have autofocus.

Closes #2813

Rationale

This is better for UX and a11y.

Changes

  • Added autofocus prop for TextInput and FileInput components in component context.
  • Updated test helpers.

Impact

N/A

Testing

Added a11y tests.

Screenshots/Video

N/A

Checklist

  • Code follows the project's coding standards.
  • Unit tests covering the new feature have been added.
  • All existing tests pass.
  • The documentation has been updated to reflect the new feature

Additional Notes

N/A

@vercel

vercel Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
blocknote Ready Ready Preview Oct 29, 2026 3:35pm UTC
blocknote-website Ready Ready Preview Oct 29, 2026 3:35pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1c9c2af9-cf9e-416e-87b1-0059d50e9068

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@blocknote/ariakit

npm i https://pkg.pr.new/@blocknote/ariakit@3220

@blocknote/code-block

npm i https://pkg.pr.new/@blocknote/code-block@3220

@blocknote/core

npm i https://pkg.pr.new/@blocknote/core@3220

@blocknote/diagram-block

npm i https://pkg.pr.new/@blocknote/diagram-block@3220

@blocknote/mantine

npm i https://pkg.pr.new/@blocknote/mantine@3220

@blocknote/math-block

npm i https://pkg.pr.new/@blocknote/math-block@3220

@blocknote/react

npm i https://pkg.pr.new/@blocknote/react@3220

@blocknote/server-util

npm i https://pkg.pr.new/@blocknote/server-util@3220

@blocknote/shadcn

npm i https://pkg.pr.new/@blocknote/shadcn@3220

@blocknote/xl-ai

npm i https://pkg.pr.new/@blocknote/xl-ai@3220

@blocknote/xl-docx-exporter

npm i https://pkg.pr.new/@blocknote/xl-docx-exporter@3220

@blocknote/xl-email-exporter

npm i https://pkg.pr.new/@blocknote/xl-email-exporter@3220

@blocknote/xl-multi-column

npm i https://pkg.pr.new/@blocknote/xl-multi-column@3220

@blocknote/xl-odt-exporter

npm i https://pkg.pr.new/@blocknote/xl-odt-exporter@3220

@blocknote/xl-pdf-exporter

npm i https://pkg.pr.new/@blocknote/xl-pdf-exporter@3220

@blocknote/xl-typst-exporter

npm i https://pkg.pr.new/@blocknote/xl-typst-exporter@3220

commit: 2c5b664

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://TypeCellOS.github.io/BlockNote/pr-preview/pr-3220/

Built to branch gh-pages at 2026-10-29 15:48 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@matthewlipski matthewlipski changed the title feat: File panel input/upload button autofocus feat: File panel input/upload button autofocus (BLO-1220) Oct 22, 2026

@nperez0111 nperez0111 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something to think about re: focus handling.

When collaboratively editing a document, just because some content exists in the doc (e.g. the upload file button), it does not mean it should get focus immediately via the html autofocus attribute. It should be focused only for the user who triggered the action, e.g. the user who when to insert that content. Otherwise you can distract others on the document by the mere insertion of content into the document.

I've had this bug on my mind for a while, but it is just so annoying to reproduce it (since one machine will only ever have focus on one window at a time), but there is some sort of principal there.

It is okay in the case of the sub-menu, because the user will have already triggered the menu to be open, so they clearly are interested in where it's sub-menus go.

@matthewlipski

Copy link
Copy Markdown
Collaborator Author

But when editing a document collaboratively, shouldn't the menus/toolbars/panels only be open for the client? I mean if I open the file panel, a different user shouldn't see it, and shouldn't lose focus of the editor because the element that takes autofocus doesn't render in the first place. Is that not currently the case?

I understand if it's an element in the editor content because then indeed it's rendered for all users, so autofocusing it would mess with everyone.

This branch was successfully deployed

2 active deployments
Preview – blocknote-website — 2c5b664e Deployed Oct 29, 2026 by vercel[bot]
Preview – blocknote — 2c5b664e Deployed Oct 29, 2026 by vercel[bot]
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.

2 participants