Skip to content

Commit 2b72d3d

Browse files
committed
f
1 parent aaac084 commit 2b72d3d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

pages/html/handleRadio.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
/**
2+
* Lightweight utility to manage a group of radio buttons using event delegation.
3+
*
4+
* Features:
5+
* - Event Delegation: Attaches one listener to a parent (defaults to document.body).
6+
* - State Management: Can set initial value (initState) and ensures a radio is checked.
7+
* - Callback: Fires `onChange(value, tool)` whenever a radio is clicked.
8+
* - Programmatic Control: Returns a `tool` object to check values, list states, or unbind.
9+
*
10+
*/
111
export default function handleRadio(opt) {
212
let tool;
313
const {

0 commit comments

Comments
 (0)