@@ -61,13 +61,18 @@ <h2 class="text-lg font-semibold text-white">Search & filter resources</h2>
6161 </ label >
6262
6363 < label >
64- < span class ="sr-only "> Filter by category</ span >
65- < select [ngModel] ="selectedCategoryFilter() " (ngModelChange) ="onCategoryFilterChange($event) "
66- class ="w-full rounded-lg border border-gray-700 bg-[#0B0E14] px-3 py-2.5 text-sm focus:outline-none focus:border-indigo-500 ">
64+ < span class ="sr-only "> Search by category</ span >
65+ < div class ="relative ">
66+ < i class ="ph ph-funnel absolute left-3 top-1/2 -translate-y-1/2 text-gray-500 "> </ i >
67+ < input [ngModel] ="selectedCategoryFilter() " (ngModelChange) ="onCategoryFilterChange($event) " list ="resource-category-filter-list "
68+ placeholder ="All categories (type to search) "
69+ class ="w-full rounded-lg border border-gray-700 bg-[#0B0E14] pl-10 pr-3 py-2.5 text-sm focus:outline-none focus:border-indigo-500 " />
70+ </ div >
71+ < datalist id ="resource-category-filter-list ">
6772 @for (categoryOption of categoryOptions(); track categoryOption) {
6873 < option [value] ="categoryOption "> {{ categoryOption === 'all' ? 'All categories' : categoryOption }}</ option >
6974 }
70- </ select >
75+ </ datalist >
7176 </ label >
7277
7378 < label >
@@ -180,9 +185,16 @@ <h2 class="text-lg sm:text-xl font-bold text-white">Add a resource</h2>
180185 < div class ="grid gap-3 sm:gap-4 md:grid-cols-2 ">
181186 < input [(ngModel)] ="title " type ="text " placeholder ="Resource title "
182187 class ="w-full rounded-lg border border-gray-700 bg-[#0B0E14] px-3 py-2.5 text-sm focus:outline-none focus:border-indigo-500 " />
183- < input [(ngModel)] ="category " type ="text " placeholder ="Category (e.g., DSA, Resume, Sheets) "
188+ < input [(ngModel)] ="category " type ="text " list =" resource-category-add-list " placeholder ="Choose category "
184189 class ="w-full rounded-lg border border-gray-700 bg-[#0B0E14] px-3 py-2.5 text-sm focus:outline-none focus:border-indigo-500 " />
185190 </ div >
191+ < datalist id ="resource-category-add-list ">
192+ @for (categoryOption of categoryOptions(); track categoryOption) {
193+ @if (categoryOption !== 'all') {
194+ < option [value] ="categoryOption "> </ option >
195+ }
196+ }
197+ </ datalist >
186198
187199 @if (contributionMode === 'link') {
188200 < input [(ngModel)] ="url " type ="url " placeholder ="https://... "
0 commit comments