Skip to content

Commit 25f6e2b

Browse files
authored
Merge pull request #91 from CS3219-AY2324S1/90-add-placeholder-to-filtering-of-questions
add placeholder
2 parents 8145fc0 + c539fb6 commit 25f6e2b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

frontend/src/components/Questions/QuestionsTable.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,16 @@ const InterviewQuestionsTable: React.FC = () => {
103103
{/* Category Filter */}
104104
<Select
105105
multiple
106+
displayEmpty
106107
value={selectedCategories}
107108
onChange={handleCategoriesChange}
108-
renderValue={(selected) => (selected as string[]).join(", ")}
109+
renderValue={(selected) => {
110+
if (selected.length === 0) {
111+
return <em>Filter by category</em>;
112+
} else {
113+
return (selected as string[]).join(", ")}
114+
}
115+
}
109116
style={{ marginTop: "10px", marginBottom: "10px", width: "80%" }}
110117
>
111118
{uniqueCategories.map((category) => (

0 commit comments

Comments
 (0)