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
If the label property is passed an HTML <label /> element will entirely obscure the <input /> element. The <label /> element isn't the parent of the <input /> and so if no id attribute associates them, the click event on the <label /> will not trigger a change event on the <input />.
Reproduce this
Create an EUIRadio with label and onChange properties. The onChange property should be a function which calls alert or runs some other code that you can use to assert that the function ran.
Load the code in a browser and click the EUIRadio component.
The function will not have run, and no alert will be shown.
Expected
If the onChange property is provided it will be run, even if label is provided and id is not.
OR, the id should be required if label is passed.
OR, the behavior should be documented
The text was updated successfully, but these errors were encountered:
Expected
If the onChange property is provided it will be run, even if label is provided and id is not.
OR, the id should be required if label is passed.
OR, the behavior should be documented
Hi there. Thanks for the work on EUI. I've really been enjoying using it. I found some behavior that I think is unexpected and threw me for a loop.
If you define an
EuiRadio
with alabel
and noid
,onChange
will not be triggered from a click.Check my codesandbox to see the example.
If the
label
property is passed an HTML<label />
element will entirely obscure the<input />
element. The<label />
element isn't the parent of the<input />
and so if noid
attribute associates them, theclick
event on the<label />
will not trigger achange
event on the<input />
.Reproduce this
EUIRadio
withlabel
andonChange
properties. TheonChange
property should be a function which callsalert
or runs some other code that you can use to assert that the function ran.EUIRadio
component.alert
will be shown.Expected
onChange
property is provided it will be run, even iflabel
is provided andid
is not.id
should be required iflabel
is passed.The text was updated successfully, but these errors were encountered: