We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aaac084 commit 2b72d3dCopy full SHA for 2b72d3d
1 file changed
pages/html/handleRadio.js
@@ -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
+ */
11
export default function handleRadio(opt) {
12
let tool;
13
const {
0 commit comments