Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,14 @@ function App() {
);
}

// BUG 6: Sort button has no accessible label and is missing type="button"
// In some browsers this causes the page to reload (treated as form submit)
// when the sort button is inside a form context. Also missing aria-pressed.
function SortButton() {
return (
<button // Missing: type="button", aria-pressed, aria-label
<button
type="button"
className={`sort-btn ${sortAsc ? "active" : ""}`}
onClick={() => setSortAsc(s => !s)}
aria-label={sortAsc ? "Sort by price descending" : "Sort by price ascending"}
aria-pressed={sortAsc}
>
Price {sortAsc ? "↑" : "↓"}
</button>
Expand Down