File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,9 +16,10 @@ export function CheckItem({
1616 checkbox,
1717} : CheckItemProps ) {
1818 return (
19- < button
20- type = "button"
21- onClick = { onToggle }
19+ < div
20+ role = "button"
21+ onClick = { checkbox ? onToggle : undefined }
22+ aria-disabled = { ! checkbox }
2223 className = { [
2324 'flex w-full items-center gap-2.5 rounded-2xl border px-4 py-2 text-left transition' ,
2425 'bg-gray-50 hover:bg-gray-100' ,
@@ -52,6 +53,6 @@ export function CheckItem({
5253 >
5354 { text }
5455 </ span >
55- </ button >
56+ </ div >
5657 ) ;
5758}
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ type CheckableItem = {
1010
1111type CheckListProps < T extends CheckableItem > = {
1212 items : T [ ] ;
13- onToggleTodo : ( id : string , checked : boolean ) => void ;
13+ onToggleTodo : ( id : string , current : boolean ) => void ;
1414 emptyText ?: string ;
1515 checkbox ?: boolean ;
1616} ;
You can’t perform that action at this time.
0 commit comments