fix(annotations): make resize overlay keyboard-interactive
Some checks failed
CI / Unit & Component Tests (push) Failing after 1s
CI / Backend Unit Tests (push) Failing after 1s
CI / Unit & Component Tests (pull_request) Failing after 2s
CI / Backend Unit Tests (pull_request) Failing after 1s

- Add tabindex="0" so the SVG can receive DOM focus
- Auto-focus the SVG on mount so arrow keys work immediately after
  clicking an annotation to select it
- Show preview rect during keyboard nudging (not just pointer drag) by
  checking hasLiveChanges instead of only checking dragState
- Suppress default browser focus outline (outline: none) on the SVG

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-14 11:47:41 +02:00
parent 9fe5b32a69
commit 2350b4f845
2 changed files with 24 additions and 4 deletions

View File

@@ -60,4 +60,12 @@ describe('AnnotationEditOverlay', () => {
const liveRegion = document.querySelector('[aria-live="polite"]');
expect(liveRegion).not.toBeNull();
});
it('SVG root has tabindex="0" so it can receive keyboard focus', async () => {
render(AnnotationEditOverlay, { annotation });
const svg = document.querySelector('svg[role="application"]');
expect(svg).not.toBeNull();
expect(svg!.getAttribute('tabindex')).toBe('0');
});
});