mantinedev/mantine

@mantine/core/Switch is missing data-checked attribute.

zstarvit opened this issue · 1 comments

Dependencies check up

  • I have verified that I use latest version of all @mantine/* packages

What version of @mantine/* packages do you have in package.json?

^7.11.2

What package has an issue?

@mantine/core

What framework do you use?

Other, I will specify in the bug description

In which browsers you can reproduce the issue?

All

Describe the bug

Note: This bug can be observed on the mantine documentation website as well

https://mantine.dev/core/switch

Checkbox and Radio elements have a data-checked attribute that is filled with the checked state of the element. For some reason Switch is missing this data attribute, and in fact none of the attributes on the DOM element change at all when the switch is checked or unchecked. This makes it impossible to inspect these elements with automation software out of the box, which seems unintended.

The .value is always 'on', while the checked property of the node changes between true and false - but the attribute on the element always stays as just checked.

If possible, include a link to a codesandbox with a minimal reproduction

No response

Possible fix

No response

Self-service

  • I would be willing to implement a fix for this issue