File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 1- import { useEffect , useState } from "react" ;
1+ import { useEffect , useState , type ChangeEvent } from "react" ;
22import FieldBadges from "./fields/FieldBadges" ;
33import Markdown from "react-markdown" ;
44import type { CollectionEntry } from "astro:content" ;
@@ -95,19 +95,17 @@ const FieldCatalog = ({ fields }: { fields: Fields }) => {
9595 className = "mr-2"
9696 value = { category }
9797 checked = { filters . categories . includes ( category ) }
98- onClick = { ( e ) => {
99- const target = e . target as HTMLInputElement ;
100-
101- if ( target . checked ) {
98+ onChange = { ( e : ChangeEvent < HTMLInputElement > ) => {
99+ if ( e . target . checked ) {
102100 setFilters ( {
103101 ...filters ,
104- categories : [ ...filters . categories , target . value ] ,
102+ categories : [ ...filters . categories , e . target . value ] ,
105103 } ) ;
106104 } else {
107105 setFilters ( {
108106 ...filters ,
109107 categories : filters . categories . filter (
110- ( f ) => f !== target . value ,
108+ ( f ) => f !== e . target . value ,
111109 ) ,
112110 } ) ;
113111 }
You can’t perform that action at this time.
0 commit comments