Skip to content

Commit 61c139f

Browse files
committed
fix(web): make task drawer scroll region keyboard accessible
1 parent 21426a7 commit 61c139f

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎apps/web/src/components/chat/ComposerTasksBadge.test.tsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,12 @@ describe("ComposerTasksBadge", () => {
101101
expect(markup).toContain('aria-label="Collapse tasks. 1 of 3 complete."');
102102
expect(markup).toContain('role="list"');
103103
expect(markup).toContain('data-composer-tasks-list="true"');
104+
expect(markup).toContain('tabindex="0"');
104105
expect(markup).toContain("max-h-[min(24rem,40dvh)]");
105106
expect(markup).toContain("overflow-y-auto");
106107
expect(markup).toContain("overscroll-contain");
108+
expect(markup).toContain("focus-visible:ring-2");
109+
expect(markup).toContain("focus-visible:ring-inset");
107110
expect(markup).toContain("Inspect the composer");
108111
expect(markup).toContain('data-composer-task-duration="true"');
109112
expect(markup).toContain("ml-auto w-10");

‎apps/web/src/components/chat/ComposerTasksBadge.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,10 @@ export const ComposerTasksDrawer = memo(function ComposerTasksDrawer({
203203
</Button>
204204
</div>
205205
<div
206-
className="max-h-[min(24rem,40dvh)] space-y-px overflow-y-auto overscroll-contain px-3 pb-4 sm:px-4"
206+
className="max-h-[min(24rem,40dvh)] space-y-px overflow-y-auto overscroll-contain px-3 pb-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/70 sm:px-4"
207207
data-composer-tasks-list="true"
208208
role="list"
209+
tabIndex={0}
209210
>
210211
{keyedTaskSteps(steps).map(({ key, step }) => (
211212
<div key={key} className="flex items-baseline gap-2 text-xs leading-5" role="listitem">

0 commit comments

Comments
 (0)