Skip to content

Commit d72bf66

Browse files
authored
fix: replace left with insetInlineStart
Currently `floatingStyles` returned from `useFloating` is overwriting placement styles and preventing `-start` to truly adapt to RTL layouts. See TypeCellOS/BlockNote#922 (comment)
1 parent cea9065 commit d72bf66

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react-dom/src/useFloating.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export function useFloating<RT extends ReferenceType = ReferenceType>(
156156
const floatingStyles = React.useMemo(() => {
157157
const initialStyles = {
158158
position: strategy,
159-
left: 0,
159+
insetInlineStart: 0,
160160
top: 0,
161161
};
162162

@@ -177,7 +177,7 @@ export function useFloating<RT extends ReferenceType = ReferenceType>(
177177

178178
return {
179179
position: strategy,
180-
left: x,
180+
insetInlineStart: x,
181181
top: y,
182182
};
183183
}, [strategy, transform, elements.floating, data.x, data.y]);

0 commit comments

Comments
 (0)