Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: storybook - fix duplicate ids for checkbox and switch (#2230)
* docs(checkbox): fix duplicate ids appearing in storybook The same value was being used for the ID attribute on the checkbox label and checkbox itself. This update makes sure they are both given different IDs based on the passed in ID, by adding a suffix to the ID used on the checkbox input. This also fixes the markup previously showing an empty ID attribute on the checkbox when the ID was not set. * docs(switch): fix duplicate ids appearing in storybook The switch was using a hardcoded ID for the input and its label, so showing multiple switches resulted in duplicate IDs. This now sets unique IDs based on the passed in ID, along with a fallback. * docs(menu): fix for duplicate ids in some stories Fix console warning "Duplicate form field id in the same form" for the Menu stories that use checkboxes and switches. * docs(checkbox): set id for default story Clear up console warning "A form field element should have an id or name attribute" by adding an ID to the default Checkbox story. * docs(checkbox): update input id value Update created unique ID for checkbox input so that it won't result in an ID like default-checkbox-checkbox --------- Co-authored-by: [ Cassondra ] <castastrophe@users.noreply.github.com>
- Loading branch information