ceenayekta commented on code in PR #34629:
URL: https://github.com/apache/superset/pull/34629#discussion_r2278671854
##########
superset-frontend/packages/superset-ui-core/src/theme/Theme.tsx:
##########
@@ -241,18 +262,23 @@ export class Theme {
const [themeState, setThemeState] = React.useState({
theme: this.theme,
antdConfig: this.antdConfig,
- emotionCache: createCache({ key: 'superset' }),
+ emotionCache: this.createCache(),
});
+ const { direction = 'ltr' } = themeState.theme;
this.updateProviders = (theme, antdConfig, emotionCache) => {
setThemeState({ theme, antdConfig, emotionCache });
+ if (theme.direction === 'rtl') {
+ document?.documentElement?.setAttribute('dir', 'rtl');
+ document?.documentElement?.setAttribute('data-direction', 'rtl');
+ }
};
Review Comment:
I'm not sure if this should be handled. Once we change the language, the
page is gonna refresh, and js code will only run for rtl languages. @justinpark
do you approve this change?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]