We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b6e9355 commit b4abd98Copy full SHA for b4abd98
1 file changed
docs/step.html
@@ -183,14 +183,16 @@
183
}
184
185
checkboxes.forEach((checkbox, index) => {
186
- checkbox.removeAttribute('disabled');
187
checkbox.disabled = false;
188
- checkbox.checked = checkedIndexes.includes(index) ? true : checkbox.checked;
+ checkbox.checked = checkedIndexes.includes(index) || checkbox.checked;
189
checkbox.setAttribute('aria-label', `Checklist item ${index + 1}`);
190
191
checkbox.addEventListener('change', () => {
192
const updated = Array.from(checkboxes)
193
- .flatMap((cb, i) => (cb.checked ? [i] : []));
+ .reduce((acc, cb, i) => {
+ if (cb.checked) acc.push(i);
194
+ return acc;
195
+ }, []);
196
localStorage.setItem(storageKey, JSON.stringify(updated));
197
});
198
0 commit comments