Skip to content

fix(mantine): make toolbar buttons tabbable in Safari - #3471

Open
ronavkarumsi04 wants to merge 1 commit into
TypeCellOS:mainfrom
ronavkarumsi04:fix/safari-tab-formatting-toolbar
Open

ronavkarumsi04 wants to merge 1 commit into
TypeCellOS:mainfrom
ronavkarumsi04:fix/safari-tab-formatting-toolbar

Conversation

@ronavkarumsi04

@ronavkarumsi04 ronavkarumsi04 commented Dec 3, 2026 •

Copy link
Copy Markdown

Summary

Fixes #2993. Pressing Tab with the formatting toolbar open never moved focus into the toolbar on macOS Safari.

Rationale

macOS Safari (WebKit on Cocoa) only puts plain <button>s in the Tab order when "Press Tab to highlight each item" is enabled. Elements with an explicit tabindex are always keyboard-focusable, so giving the Mantine toolbar controls tabIndex={0} makes Tab reach them under Safari's default settings, as it already does in Chrome and Firefox.

Changes

  • ToolbarButton (both the Button and ActionIcon variants) and the ToolbarSelect trigger in @blocknote/mantine set tabIndex={0}.
  • New browser test in DesktopFormattingToolbarController.browser.test.tsx: Tab from the editor reaches the block type control and then Bold, the controls carry tabindex="0", and the selection and document are unchanged.

Impact

No change in browsers that already tab to buttons; the editor's own Tab handling and the mobile tap-focus prevention (preventFocusOnTap) are untouched.

Testing

  • New test fails before the fix (tabindex was null) and passes after.
  • Core and React unit suites pass; targeted Chromium, WebKit and mobile-emulation browser suites pass; pnpm lint clean.
  • Manually checked the minimal example in Playwright WebKit (Linux): Tab goes Paragraph -> Bold. Native macOS Safari was not available to test.

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

Prepared with AI assistance (Devin).

Summary by CodeRabbit

  • Accessibility
    • Toolbar buttons can now receive keyboard focus, allowing users to tab from the editor through paragraph and formatting controls.

Copilot AI balanced review requested due to automatic review settings December 3, 2026 18:11
@vercel

vercel Bot commented Dec 3, 2026

Copy link
Copy Markdown

@ronavkarumsi04 is attempting to deploy a commit to the TypeCell Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Toolbar button variants and the toolbar select button now set tabIndex to zero. A browser test checks that Tab moves focus to the paragraph-type button and then the bold button, without changing the selection or document.

Changes: Toolbar keyboard focus

Layer / File(s) Summary
Make toolbar controls keyboard focusable
packages/mantine/src/toolbar/ToolbarButton.tsx, packages/mantine/src/toolbar/ToolbarSelect.tsx, packages/react/src/components/FormattingToolbar/DesktopFormattingToolbarController.browser.test.tsx
Toolbar buttons explicitly set tabIndex to zero. A browser test checks Tab focus order and confirms that the selection and document remain unchanged.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related issues

Suggested reviewers: nperez0111, matthewlipski

Merge Risk: Minimal · up to 9bce3

This change lets Tab reach the formatting toolbar controls in Safari. It is a small, low-risk change with a regression test, and nothing blocks merging.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(mantine): make toolbar buttons tabbable in Safari" matches the main change. The PR sets tabIndex={0} on the Mantine ToolbarButton and ToolbarSelect so Tab reaches the toolbar in macOS S…
Description check Passed The description follows the repository template. It includes Summary, Rationale, Changes, Impact, Testing, and Checklist sections, and it links issue #2993. The Screenshots/Video section is absent, th…
Linked Issues check Passed [#2993] Issue #2993 requires that pressing Tab with the formatting toolbar open moves focus into the toolbar in macOS Safari. The reviewed diff adds tabIndex={0} to both ToolbarButton variants (`M…
Out of Scope Changes check Passed [#2993] All changed hunks relate to the linked issue. The three tabIndex={0} additions are in toolbar button and select trigger components in @blocknote/mantine. The only test change is a new keyboa…
Full details: Title check

Explanation

The title "fix(mantine): make toolbar buttons tabbable in Safari" matches the main change. The PR sets tabIndex={0} on the Mantine ToolbarButton and ToolbarSelect so Tab reaches the toolbar in macOS Safari. The title is specific, short, and names the affected package and browser.

Full details: Description check

Explanation

The description follows the repository template. It includes Summary, Rationale, Changes, Impact, Testing, and Checklist sections, and it links issue #2993. The Screenshots/Video section is absent, though it applies only when relevant to the change. The documentation checkbox is unchecked and the description says documentation was not updated. Testing details are specific.

Full details: Linked Issues check

Explanation

[#2993] Issue #2993 requires that pressing Tab with the formatting toolbar open moves focus into the toolbar in macOS Safari. The reviewed diff adds tabIndex={0} to both ToolbarButton variants (MantineButton with children, and MantineActionIcon) in packages/mantine/src/toolbar/ToolbarButton.tsx, and to the ToolbarSelect trigger MantineButton in packages/mantine/src/toolbar/ToolbarSelect.tsx. The change targets the cause described in the PR: Safari only tabs to plain buttons when the Tab-highlight setting is enabled. Explicit tabindex makes these controls keyboard-focusable by default. The new browser test in DesktopFormattingToolbarController.browser.test.tsx asserts that Tab moves focus from the editor to the block type button and then to Bold, and that both have tabindex="0". The test does not run native Safari. The PR author reports a Playwright WebKit check on Linux, but the native macOS Safari behavior is not verified.

Full details: Out of Scope Changes check

Explanation

[#2993] All changed hunks relate to the linked issue. The three tabIndex={0} additions are in toolbar button and select trigger components in @blocknote/mantine. The only test change is a new keyboard test in the formatting toolbar browser suite that checks the same Tab path. The diff does not modify the editor's Tab handling or preventFocusOnTap behavior. The diff shows no unrelated files or refactors. The PR description states that documentation was not updated, and no documentation change is required by the issue.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
Fix failing CI checks

  • Create a new PR
  • 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

A rabbit taps Tab, and the toolbar draws near.
The paragraph button receives focus clear.
One more tap brings bold into view.
The text stays selected; the document stays true.
Ears perk as the keys hop through.

Recent review info

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: ef98c3ee-eee5-49b3-b973-4d83c5a4eaa2
Commits

Reviewing files that changed from the base of the PR and between 241d3c9 and 9bce342.

Files selected for processing: 3

  • packages/mantine/src/toolbar/ToolbarButton.tsx
  • packages/mantine/src/toolbar/ToolbarSelect.tsx
  • packages/react/src/components/FormattingToolbar/DesktopFormattingToolbarController.browser.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@nperez0111

Copy link
Copy Markdown
Contributor

@matthewlipski this seems like a good fix. can you validate?

This branch has not been deployed

No deployments
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.

bug: Tab doesn't move focus into formatting toolbar macOS Safari

4 participants