fix: Camera aspect-ratio should always apply (#2114)

- Closes #2073
This commit is contained in:
Dermot Duffy
2025-07-13 14:56:03 -07:00
committed by GitHub
parent d0bfb97843
commit c3e7cef9cf
29 changed files with 812 additions and 201 deletions
-30
View File
@@ -35,36 +35,6 @@ export const callEmblaHandler = (
}
};
export const callResizeHandler = (
entries: {
target: HTMLElement;
width: number;
height: number;
}[],
n = 0,
): void => {
const mockResult = vi.mocked(ResizeObserver).mock.results[n];
if (mockResult.type !== 'return') {
return;
}
const observer = mockResult.value;
vi.mocked(ResizeObserver).mock.calls[n][0](
// Note this is a very incomplete / invalid ResizeObserverEntry that
// just provides the bare basics current implementation uses.
entries.map(
(entry) =>
({
target: entry.target,
contentRect: {
height: entry.height,
width: entry.width,
},
}) as unknown as ResizeObserverEntry,
),
observer,
);
};
export const createEmblaApiInstance = (options?: {
slideNodes?: HTMLElement[];
selectedScrollSnap?: number;