Skip to content

Commit 623ef84

Browse files
committed
fix(webapp): make query result sorting keyboard accessible
1 parent 398a6ce commit 623ef84

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

apps/webapp/app/components/code/TSQLResultsTable.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -960,11 +960,17 @@ function HeaderCellContent({
960960
) : (
961961
<span className="min-w-0 flex-1 truncate text-left">{children}</span>
962962
)}
963-
{/* Sort indicator */}
963+
{/* The full header remains a pointer target, while this dedicated control makes sorting keyboard-accessible without nesting the tooltip or filter controls. */}
964964
{canSort && (
965-
<span
965+
<button
966+
type="button"
967+
aria-label="Toggle sort"
968+
onClick={(event) => {
969+
event.stopPropagation();
970+
onSortClick?.(event);
971+
}}
966972
className={cn(
967-
"shrink-0 transition-colors",
973+
"shrink-0 rounded transition-colors focus-custom",
968974
sortHighlighted ? "text-text-bright" : "text-text-dimmed"
969975
)}
970976
>
@@ -975,7 +981,7 @@ function HeaderCellContent({
975981
) : (
976982
<ChevronUpDownIcon className="size-4" />
977983
)}
978-
</span>
984+
</button>
979985
)}
980986
{onFilterClick && (
981987
<button

0 commit comments

Comments
 (0)