fix(ui): degrade combobox loading spinner under reduced motion

This commit is contained in:
Alan Buscaglia
2026-06-11 16:14:00 +02:00
parent dcefbab827
commit 0697b568fe
2 changed files with 19 additions and 1 deletions
@@ -101,6 +101,24 @@ describe("Combobox", () => {
expect(unselectedCheck).toHaveClass("scale-95", "opacity-0");
});
it("degrades the loading spinner animation under reduced motion", async () => {
// Given
const user = userEvent.setup();
render(
<Combobox options={options} placeholder="Select provider" loading />,
);
// When
await user.click(
screen.getByRole("combobox", { name: /select provider/i }),
);
const content = document.querySelector("[data-slot='popover-content']");
const spinner = content?.querySelector("svg");
// Then
expect(spinner).toHaveClass("animate-spin", "motion-reduce:animate-none");
});
it("opens with the shared Popover content motion contract", async () => {
// Given
const user = userEvent.setup();
+1 -1
View File
@@ -139,7 +139,7 @@ export function Combobox({
<CommandList className="minimal-scrollbar max-h-[400px]">
{loading && (
<div className="text-text-neutral-tertiary flex items-center gap-2 px-3 py-2 text-sm">
<Loader2 className="h-4 w-4 animate-spin" />
<Loader2 className="h-4 w-4 animate-spin motion-reduce:animate-none" />
<span>{loadingMessage}</span>
</div>
)}