v5.0.0-alpha
Pre-release⚠️ Important information
This pre-release includes 3 breaking change done to improve web accessibility.
Please consider giving us feedback in the release discussion page to improve the v5.0.0 version.
1️⃣ ECMAS as main interface
You can continue using jQuery interface but the file to import had been renamed adding the jquery
suffix.
This change has been made because bootstrap have dropped jQuery dependency, so using jQuery as main interface include a new dependency that bootstrap don't have.
2️⃣ Rename option and data attribute for labels
You can continue using on
and off
options and data-attributes, but a deprecated warning will be logged in console. Please consider using onlabel
and offlabel
instead because support for deprecated options and data attributes can be removed in future versions.
In previous version, we have been adding options and data attributes to set custom property to each part of the toggle. This two legacy options and data attributes can be confusing now, so we have aligned their names with the more recent options and data attributes.
3️⃣ Change toggle on and off elements to span
Your customs styles can be affected if you were selecting toggle on and toggle off elements by the label
. Please consider using .toggle > .toggle-group > .btn:not(.toggle-handle)
instead.
The Web Content Accessibility Guidelines (WCAG) establish that an element can have only one label. With the previous approach, the toggle element had at leats two labels (even three or more if the original checkbox had one or many).
ℹ️ What's Changed
🆕 Added
- feat: Click on label switch and focus the toggle element by @palcarazm in #102
- feat: Add title definition support Closes #98 by @palcarazm in #103
🔁 Changed
- feat!: Set ecmas interface as main interface by @palcarazm in #95
- feat!: Change on and off option to onlabel and offlabel Closes #99 by @palcarazm in #100
- feat!: Change toggleOn and toggleOff elements from label to span Closes #96 by @palcarazm in #101
🆙 Bump
- bump: bump jquery from 3.6.2 to 3.6.3 by @dependabot in #93
- bump: bump cypress from 12.1.0 to 12.2.0 by @dependabot in #94
Full Changelog: v4.3.6...v5.0.0-alpha