Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add d2l-switch-before-change event to give consumers control of state #5168

Merged
merged 4 commits into from
Nov 21, 2024

Conversation

dbatiste
Copy link
Contributor

@dbatiste dbatiste commented Nov 20, 2024

GAUD-7204

This PR adds the d2l-switch-before-change event to give consumers the ability to control the state. For instance, the consumer may display a confirmation dialog, and then toggle the switch state depending on the user's choice.

This approach mirrors what we recently did for d2l-button-toggle for the same type of scenario.

The demo page shows it in action.

@dbatiste dbatiste requested a review from a team as a code owner November 20, 2024 22:58
Copy link
Contributor

Thanks for the PR! 🎉

We've deployed an automatic preview for this PR - you can see your changes here:

URL https://live.d2l.dev/prs/BrightspaceUI/core/pr-5168/

Note

The build needs to finish before your changes are deployed.
Changes to the PR will automatically update the instance.

components/switch/switch-mixin.js Outdated Show resolved Hide resolved
components/switch/test/switch.test.js Outdated Show resolved Hide resolved
@dbatiste dbatiste merged commit 682b0d5 into main Nov 21, 2024
6 checks passed
@dbatiste dbatiste deleted the dbatiste/switch-state branch November 21, 2024 15:54
Copy link

🎉 This PR is included in version 3.72.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants