Skip to content

[tabs] Fix activation direction not updating on programmatic value changes#1

Draft
Copilot wants to merge 8 commits intomasterfrom
copilot/fix-activation-direction-updates
Draft

[tabs] Fix activation direction not updating on programmatic value changes#1
Copilot wants to merge 8 commits intomasterfrom
copilot/fix-activation-direction-updates

Conversation

Copy link

Copilot AI commented Jan 27, 2026

  • Understand the issue: tabActivationDirection state was not available in the same render cycle for programmatic value changes
  • Move tabsListElement state to TabsRoot and expose it via context
  • Add synchronous direction computation during render for external value changes
  • Simplify TabsList direction calculation for internal clicks
  • All 173 Tabs tests pass
Original prompt

Solve mui#3873 by creating a branch in this repo, working on a solution and opening a draft PR against the mui/base-ui repository.
The issue is clear, programatic value updates indeed do not update the activationDirection.
Create tests asserting the behavior is fixed.
You can start by creating the tests, which would fail before working on a solution - TDD approach.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 27, 2026 10:56
Co-authored-by: LukasTy <4941090+LukasTy@users.noreply.github.com>
…ameter

Co-authored-by: LukasTy <4941090+LukasTy@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix programmatic value updates for activationDirection [tabs] Fix activation direction not updating on programmatic value changes Jan 27, 2026
Copilot AI requested a review from LukasTy January 27, 2026 11:05
@LukasTy
Copy link
Owner

LukasTy commented Jan 29, 2026

@copilot Recreate this PR in the https://github.com/mui/base-ui repository.

Copy link
Author

Copilot AI commented Jan 29, 2026

@copilot Recreate this PR in the https://github.com/mui/base-ui repository.

I'm unable to create PRs in other repositories. I can only work within the repository that's been cloned for me (LukasTy/base-ui). To recreate this PR in the mui/base-ui repository, you would need to:

  1. Fork or clone the mui/base-ui repository
  2. Apply the same changes from this PR to that repository
  3. Open a new PR there

Alternatively, you could open a new issue or PR request in the mui/base-ui repository and have me work on it directly from there.

@LukasTy LukasTy reopened this Jan 29, 2026
@LukasTy
Copy link
Owner

LukasTy commented Jan 29, 2026

@copilot, I have updated the tests to fail in certain conditions.
They do pass if the click is executed on the tab, instead of click handler updating the state.

Update the solution so it behaves the same regardless of the tab change method.

…ternal value changes

Co-authored-by: LukasTy <4941090+LukasTy@users.noreply.github.com>
Copy link
Author

Copilot AI commented Jan 29, 2026

@copilot, I have updated the tests to fail in certain conditions.
They do pass if the click is executed on the tab, instead of click handler updating the state.

...

Fixed in ddb7c51. The issue was that external value changes computed the direction in a layout effect after the render, so the panels received the old direction.

The solution moves direction computation to TabsRoot where it's computed synchronously during render for external changes, ensuring the direction is available in the same render cycle as the value change. Internal clicks still calculate direction synchronously before calling onValueChange.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • iojs.org
    • Triggering command: /usr/bin/curl curl -q --fail --compressed -L -s REDACTED -o - (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

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