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

fix(Toggle): if content on one side only then clicking toggles #205

Merged
merged 1 commit into from
Dec 26, 2023

Conversation

jerefrer
Copy link
Contributor

Currently:

  1. if a left content is specified then clicking on it will switch the Toggle off.
  2. if a right content is specified then clicking on it will switch the Toggle on.
  3. if both side contents are specified then clicking left will switch off and clicking right will switch on.

I believe cases 1 and 2 are counter-intuitive. If there is content defined on one side only I would expect that it's just the name for this variable and that clicking the label would have the same effect as clicking on the Toggle itself.

If there are contents on both sides then I would expect that they are "on/off" labels, therefore case 3 is fine with me.

So I updated the code so that:

  1. if a left content only is specified then clicking on it will switch the Toggle on and off.
  2. if a right content only is specified then clicking on it will switch the Toggle on and off.
  3. if both side contents are specified then clicking left will switch off and clicking right will switch on.

Copy link

vercel bot commented Dec 26, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
stwui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 26, 2023 10:58am

@N00nDay N00nDay merged commit fadbd5b into N00nDay:main Dec 26, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants