fix(Tabs): keep rename input mounted when triggered from tab menu#1176
Merged
Conversation
Previously, clicking "Rename" in a tab's menu mounted the inline-edit input only to have it stolen-focus + committed-out by the closing Menu popover's `<FocusScope restoreFocus>` ~350ms later. The user saw the menu close and nothing else happened. InlineInput now ignores blurs within ~500ms of a programmatic `startEditing()` call (cleared on the first user keystroke). TabButton also retries focusing the input across the menu's exit transition as a belt-and-suspenders defense. Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: c17349a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
📦 NPM canary releaseDeployed canary version 0.0.0-canary-844aa2d. |
Contributor
🏋️ Size limit report
Click here if you want to find out what is changed in this build |
Contributor
🧪 Storybook is successfully deployed!
|
Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3a27996. Configure here.
…s in all menu modes scheduleRenameRefocus previously queried containerRef and actionsRef, but `containerRef` is shadowed by `contextMenu.targetRef` when context menu is enabled and `actionsRef` is never attached for `contextMenu="context-only"` tabs without delete handlers or custom actions. The refocus loop became a silent no-op in that configuration. Switch to the tab button ref (`<TabElement>`) — which is always wired up and contains the InlineInput — and add a regression test for the context-only no-actions path. Co-authored-by: Cursor <cursoragent@cursor.com>
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.

Previously, clicking "Rename" in a tab's menu mounted the inline-edit input only to have it stolen-focus + committed-out by the closing Menu popover's
<FocusScope restoreFocus>~350ms later. The user saw the menu close and nothing else happened.InlineInput now ignores blurs within ~500ms of a programmatic
startEditing()call (cleared on the first user keystroke). TabButton also retries focusing the input across the menu's exit transition as a belt-and-suspenders defense.Note
Medium Risk
Touches focus/blur-driven commit behavior in
InlineInput, so timing-based guardrails could affect other consumers relying onsubmitOnBlursemantics; changes are well-covered by new regression tests.Overview
Fixes a Tabs rename regression where selecting Rename from the tab menu could immediately blur, trigger
submitOnBlur, and unmount the editor.InlineInputnow applies a ~500ms grace period after an imperativestartEditing()where an immediate blur re-focuses/selects the input instead of committing, andTabButtonadds a short refocus retry loop during the menu exit transition to keep the rename input focused (includingcontextMenu="context-only"cases).Adds targeted regression tests for the focus-theft scenario, tweaks a Dialog story play step to wait for menu close/transition stability, and slightly adjusts the
surface-4palette saturation.Reviewed by Cursor Bugbot for commit c17349a. Bugbot is set up for automated code reviews on this repo. Configure here.