Skip to content

RTL affects vertical cross axis offsets for popper #21840

Description

@ling1726

Environment Information

  • Package version(s): v9 and v0

Please provide a reproduction of the bug in a codepen:

https://codesandbox.io/s/elastic-banach-78uu1p?file=/example.tsx

Actual behavior:

The current offset modifier used in usePopper will always invert the offset of the cross axis for all placements.

const offsetModifier = React.useMemo(
() =>
offset
? {
name: 'offset',
options: { offset: isRtl ? applyRtlToOffset(offset) : offset },
}
: null,
[offset, isRtl],
);

This means that even if the cross axis is vertical, the offset is inverted in RTL.

Expected behavior:

If the cross axis is vertical, then offset should be unchanged.

Priorities and help requested:

Are you willing to submit a PR to fix? Yes

Requested priority: Normal

Products/sites affected: (if applicable)

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions