Skip to content

fix(InlineInput): focus management#1202

Merged
tenphi merged 3 commits into
mainfrom
fix-inline-input-focus
Jun 5, 2026
Merged

fix(InlineInput): focus management#1202
tenphi merged 3 commits into
mainfrom
fix-inline-input-focus

Conversation

@tenphi

@tenphi tenphi commented Jun 5, 2026

Copy link
Copy Markdown
Member

Note

Medium Risk
Focus and blur/commit behavior changed for a shared UI primitive; regressions could affect keyboard navigation and embedded hosts (e.g. Tabs with keyboardActivation=false).

Overview
Fixes InlineInput keyboard focus so the display ring cannot stick after edit ends, tab-away, or blur commits, and so standalone keyboard users get sensible focus return without a spurious ring.

Focus ring: useFocusWithin now tracks whether focus is actually inside the control (including an element-removal fallback useFocusRing lacked on the display span). Display-mode data-focused requires isFocusVisible, isFocusWithin, and editable state; a one-shot ringSuppressed hides the ring after programmatic focus restore. onBlurWithin ignores spurious blurs when entering edit mode and calls commit(draft, false) on real blur so focus is not pulled back.

Focus restore: After Enter/Escape (and similar edit-ends when keyboardActivation is on), a layout effect returns focus to the root span unless onSubmit/onCancel already moved focus elsewhere. Submit-on-blur does not restore.

Tests cover Enter commit focus return, handler-owned focus, and ring clearing when focus leaves during editing.

Reviewed by Cursor Bugbot for commit a0a459d. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot

changeset-bot Bot commented Jun 5, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a0a459d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Jun 5, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
cube-ui-kit Ready Ready Preview, Comment Jun 5, 2026 1:38pm

Request Review

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

📦 NPM canary release

Deployed canary version 0.0.0-canary-7ac8af8.

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

🧪 Storybook is successfully deployed!

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

🏋️ Size limit report

Name Size Passed?
All 396.76 KB (+0.05% 🔺) Yes 🎉
Tree shaking (just a Button) 113.45 KB (0% 🟰) Yes 🎉

Click here if you want to find out what is changed in this build

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 43f9e30. Configure here.

Comment thread src/components/content/InlineInput/InlineInput.tsx
@tenphi tenphi merged commit 0945444 into main Jun 5, 2026
16 checks passed
@tenphi tenphi deleted the fix-inline-input-focus branch June 5, 2026 13:45
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