Skip to content

Commit 55cc688

Browse files
committed
Check label.control if exists
1 parent 291d42e commit 55cc688

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ export default function subscribe(container: HTMLElement): Subscription {
5858

5959
function onMouseDown(event: MouseEvent): void {
6060
if (!(event.target instanceof Element)) return
61-
if (event.target.hasAttribute('data-check-all-item')) {
61+
const target = event.target instanceof HTMLLabelElement ? event.target.control || event.target : event.target
62+
if (target.hasAttribute('data-check-all-item')) {
6263
shiftKey = event.shiftKey
6364
}
6465
}

0 commit comments

Comments
 (0)