Skip to content

Update theme object to include direction property - #5427

Closed
MaddipatlaChetan24 wants to merge 1 commit into
uber:mainfrom
MaddipatlaChetan24:patch-14
Closed

MaddipatlaChetan24 wants to merge 1 commit into
uber:mainfrom
MaddipatlaChetan24:patch-14

Conversation

@MaddipatlaChetan24

Copy link
Copy Markdown
Contributor

Fixes #1, Fixes #2

Description

setTheme() replaces this.state.theme entirely with a fresh object from themes[themeName] on every call, without preserving any direction override that toggleDirection() had previously merged in. Since toggleTheme() calls setTheme(), the sequence "toggle direction to RTL, then toggle the color theme" silently reverts theme.direction back to "ltr", while the separate this.state.direction field (used by DirectionContext.Provider) still correctly reports "rtl". Result: BaseProvider (which baseui components read theme.direction from) renders LTR while the rest of the app, via DirectionContext, still behaves as RTL.

Fix: setTheme() now merges the currently-active this.state.direction into the theme object it constructs, instead of dropping it.

Confirmed the desync and the fix with a standalone state-transition simulation (not run against the actual React app — no build environment available here).

Scope

Patch: Bug Fix

@MaddipatlaChetan24

Copy link
Copy Markdown
Contributor Author

please check this !!

@dyesin

dyesin commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

Not really needed. No tests provided.

@dyesin dyesin closed this Sep 25, 2026
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