Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
Toggle the checkbox when clicking on the label
Kipras Melnikovas4e4ae0a7d05e
diff --git a/components/common/Checkbox.js b/components/common/Checkbox.jsindex 67eea80d8..9b76e8053 100644--- a/components/common/Checkbox.js+++ b/components/common/Checkbox.js@@ -7,12 +7,14 @@ import styles from './Checkbox.module.css';function Checkbox({ name, value, label, onChange }) {const ref = useRef();+ const onClick = () => ref.current.click();+return (<div className={styles.container}>- <div className={styles.checkbox} onClick={() => ref.current.click()}>+ <div className={styles.checkbox} onClick={onClick}>{value && <Icon icon={<Check />} size="small" />}</div>- <label className={styles.label} htmlFor={name}>+ <label className={styles.label} htmlFor={name} onClick={onClick}>{label}</label><inputdiff --git a/components/common/Checkbox.module.css b/components/common/Checkbox.module.cssindex 267a4054e..c9a01eacb 100644--- a/components/common/Checkbox.module.css+++ b/components/common/Checkbox.module.css@@ -17,6 +17,7 @@.label {margin-left: 10px;+ user-select: none; /* disable text selection when clicking to toggle the checkbox */}.input {