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
So we currently use antd which produces the following DOM. Notice the DOM structure label > span > input. It appears that this particular hierarchy prevents the checkbox from being selectable in happy-dom. However, it works as is in jsdom. But If we drop the span, it then works with happy-dom:
// Does not work<label><spanclassName="ant-checkbox"><inputtype="checkbox"value=""defaultValue=""/></span>
Default group
</label>// works<label><inputtype="checkbox"value=""defaultValue=""/>Defaultgroup</label>
again, we're using antd, so we most likely do not have control over the generated DOM.
Output:
TestingLibraryElementError: Unable to find an accessible element with the role "checkbox" and name `/Default/i`
Here are the accessible roles:
textbox:
Name "name":
<input
aria-label="name"
defaultvalue="hello"
id="name"
style="max-width: 280px;"
type="text"
/>
--------------------------------------------------
checkbox:
Name "checkbox":
<input
defaultvalue="checked"
id="checkbox"
name="checkbox"
type="checkbox"
value="checked"
/>
Name "":
<input
defaultvalue=""
type="checkbox"
value=""
/>
--------------------------------------------------
The text was updated successfully, but these errors were encountered:
frankandrobot
changed the title
span-wrapped checkboxes are not selectable (antd checkboxes)
span-wrapped checkboxes are not selectable (ant design)
Jul 5, 2022
So we currently use antd which produces the following DOM. Notice the DOM structure
label > span > input
. It appears that this particular hierarchy prevents the checkbox from being selectable inhappy-dom
. However, it works as is injsdom
. But If we drop the span, it then works withhappy-dom
:Repo example: https://gitlab.com/robotandkid/the-sandbox/-/tree/feat/upgrade-happy#9174d1c0208cb45596ee7569e67ff371667941e9
environment:
Notes:
Output:
The text was updated successfully, but these errors were encountered: