fix(design): preserve gallery controls in RTL (#7419)

This commit is contained in:
白熱
2026-08-05 12:03:25 +08:00
committed by GitHub
parent df9e9d70b7
commit 01c30db9aa
2 changed files with 11 additions and 0 deletions
@@ -158,6 +158,7 @@ export function Gallery(props: IGalleryProps) {
univer-absolute univer-bottom-6 univer-left-1/2 univer-flex -univer-translate-x-1/2
univer-items-center univer-gap-3 univer-rounded-full univer-bg-gray-800 univer-px-6 univer-py-3
univer-text-gray-400
rtl:univer-flex-row-reverse
`}
>
{hasPagination && (
@@ -84,6 +84,16 @@ describe('Gallery', () => {
expect(screen.getByRole('button', { name: /reset zoom/i })).toBeInTheDocument();
});
it('keeps the toolbar controls in logical order in RTL', () => {
render(
<ConfigProvider locale={enUS.design} direction="rtl" mountContainer={document.body}>
<Gallery images={images} open />
</ConfigProvider>
);
expect(screen.getByRole('dialog').querySelector('footer')).toHaveClass('rtl:univer-flex-row-reverse');
});
it('zoom in/out/reset buttons adjust the image scale', () => {
renderGallery({ images, open: true });
const img = screen.getByRole('img');