chore: refactor listen to input change

This commit is contained in:
Zephyruso 2023-08-31 20:02:07 +08:00
parent d2b5c17d8c
commit adfa4324ef

View File

@ -30,12 +30,12 @@ const Collapse: ParentComponent<Props> = (props) => {
'collapse collapse-arrow overflow-visible border-secondary bg-base-200', 'collapse collapse-arrow overflow-visible border-secondary bg-base-200',
)} )}
> >
<div <input
class="collapse-title text-xl font-medium" type="checkbox"
onClick={() => onCollapse(!props.isOpen)} onChange={(e) => onCollapse(e.target.checked)}
> checked={props.isOpen}
{title} />
</div> <div class="collapse-title text-xl font-medium">{title}</div>
<div <div
class={twMerge( class={twMerge(
getCollapseContentClassName(), getCollapseContentClassName(),