Fix some lint

This commit is contained in:
Gregory Schier
2026-03-13 07:36:26 -07:00
parent 7f4eedd630
commit e4103f1a4a
13 changed files with 18 additions and 17 deletions

View File

@@ -54,7 +54,7 @@ export function AutoScroller<T>({
useLayoutEffect(() => {
if (!autoScroll) return;
data.length; // Make linter happy. We want to refresh when length changes
void data.length; // Trigger refresh when length changes
const el = containerRef.current;
if (el == null) return;

View File

@@ -62,13 +62,13 @@ export function SegmentedControl<T extends string>({
if (e.key === 'ArrowRight') {
e.preventDefault();
const newIndex = Math.abs((selectedIndex + 1) % options.length);
options[newIndex] && setSelectedValue(options[newIndex].value);
if (options[newIndex]) setSelectedValue(options[newIndex].value);
const child = containerRef.current?.children[newIndex] as HTMLButtonElement;
child.focus();
} else if (e.key === 'ArrowLeft') {
e.preventDefault();
const newIndex = Math.abs((selectedIndex - 1) % options.length);
options[newIndex] && setSelectedValue(options[newIndex].value);
if (options[newIndex]) setSelectedValue(options[newIndex].value);
const child = containerRef.current?.children[newIndex] as HTMLButtonElement;
child.focus();
}