You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When the EuiCheckableCard component is set with the checkableType="checkbox" property, the handler passed to onChange is invoked twice when the click occurs directly on the checkbox itself, while it triggers correctly only once when clicking around the checkbox or on the label.
✅ onChange triggered once
❌ onChange triggered twice
Environment and versions
EUI version: 103
React version: 18
To Reproduce
Run this component in isolation
exportdefault()=>{const[checkbox,setCheckbox]=useState(false);constcheckboxCardId=useGeneratedHtmlId({prefix: 'checkboxCard'});return(<EuiCheckableCardid={checkboxCardId}label="I am a checkbox"checkableType="checkbox"value="checkbox1"checked={checkbox}onChange={()=>setCheckbox(prev=>!prev)}/>);};
N.B. Differently from the demo in the docs, the boolean update is made with a functional update to demonstrate how this could easily break depending on what the event handler does.
Expected behavior
The event handler passed to onChange should always be invoked once, indipendently from where the click occurs in the card.
Describe the bug
When the
EuiCheckableCardcomponent is set with thecheckableType="checkbox"property, the handler passed toonChangeis invoked twice when the click occurs directly on the checkbox itself, while it triggers correctly only once when clicking around the checkbox or on the label.✅
onChangetriggered once❌
onChangetriggered twiceEnvironment and versions
To Reproduce
Run this component in isolation
N.B. Differently from the demo in the docs, the boolean update is made with a functional update to demonstrate how this could easily break depending on what the event handler does.
Expected behavior
The event handler passed to
onChangeshould always be invoked once, indipendently from where the click occurs in the card.Screenshots (Optional)
Screen.Recording.2025-06-11.at.14.33.49.mov