Skip to content

Commit 551bd88

Browse files
authored
Merge pull request #645 from Priyanka0205-CSE/fix/accessibility-keyboard-aria-640
fix(accessibility): improve keyboard navigation and ARIA labeling in Profile (#640)
2 parents 24614bc + 7670e25 commit 551bd88

4 files changed

Lines changed: 744 additions & 3460 deletions

File tree

src/pages/Friends.jsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,18 @@ export const Friends = () => {
185185
? leaderboardStandings
186186
: connections[activeTab] || [];
187187
const filteredDevelopers = React.useMemo(() => {
188-
return activeDevelopers.filter((dev) => {
189-
if (selectedCollege === "All") return true;
190-
return dev.college === selectedCollege;
191-
});
192-
}, [activeDevelopers, selectedCollege]);
188+
// 1. Calculate activeDevelopers INSIDE the memo
189+
const activeDevelopers =
190+
activeTab === "leaderboard"
191+
? leaderboardStandings
192+
: connections[activeTab] || [];
193193

194+
// 2. Perform the filter
195+
return activeDevelopers.filter((dev) => {
196+
if (selectedCollege === "All") return true;
197+
return dev.college === selectedCollege;
198+
});
199+
}, [activeTab, leaderboardStandings, connections, selectedCollege]);
194200
const tabCopy = {
195201
friends:
196202
"Developers who follow you back and collaborate with you across RankerHub.",

0 commit comments

Comments
 (0)