@@ -13,7 +13,6 @@ import {
1313import type { BasicButtonProps } from '../basic-button/basic-button'
1414import type { FormCheckboxProps } from '../form-checkbox/form-checkbox'
1515import '../form-textbox/form-textbox'
16- import '../form-radiogroup/form-radiogroup'
1716
1817export type ModuleTodoProps = {
1918 readonly active : HTMLElement [ ]
@@ -30,6 +29,7 @@ export default component(
3029 const textbox = requireDescendant ( el , 'form-textbox' )
3130 const template = requireDescendant ( el , 'template' )
3231 const list = requireDescendant ( el , 'ol' )
32+ const filter = el . querySelector ( 'form-radiogroup' )
3333
3434 return [
3535 // Control todo input form
@@ -64,18 +64,10 @@ export default component(
6464 // Control todo list
6565 first (
6666 'ol' ,
67- setAttribute (
68- 'filter' ,
69- read (
70- el ,
71- 'form-radiogroup' ,
72- target => target ?. getSignal ( 'value' ) . get ( ) ?? 'all' ,
73- ) ,
74- ) ,
67+ setAttribute ( 'filter' , read ( filter , 'value' , 'all' ) ) ,
7568 on ( 'click' , ( e : Event ) => {
7669 const target = e . target as HTMLElement
77- if ( target . localName === 'button' )
78- target . closest ( 'li' ) ! . remove ( )
70+ if ( target . closest ( 'button' ) ) target . closest ( 'li' ) ! . remove ( )
7971 } ) ,
8072 ) ,
8173
0 commit comments