Skip to content

Commit 4e7d1dc

Browse files
committed
fix: Regression with RTL direction identification
1 parent 27fcdef commit 4e7d1dc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/components/SplitPane/hooks/memos/useIsLtr.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import { useMemo } from 'react';
22
import { Direction, SplitType } from '../../index';
33

44
export function useIsLtr({ split, direction }: { direction?: Direction; split: SplitType }) {
5-
return useMemo(() => !(direction === 'rtl' && split === 'vertical'), [split, direction]);
5+
return useMemo(() => (split === 'vertical' ? direction !== 'rtl' : true), [split, direction]);
66
}

src/components/SplitPane/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export interface SplitPaneProps {
5858
children: React.ReactChild[];
5959
}
6060

61-
export const SplitPane = ({ className = '', direction = 'ltr', ...props }: SplitPaneProps) => {
61+
export const SplitPane = ({ className = '', ...props }: SplitPaneProps) => {
6262
const collapsedSizes = useCollapsedSizes(props);
6363
const isLtr = useIsLtr(props);
6464

0 commit comments

Comments
 (0)