fix(button): fix dark mode toggle click - I201#206
fix(button): fix dark mode toggle click - I201#206DianaLease merged 9 commits intoaccordproject:mainfrom
Conversation
✅ Deploy Preview for ap-template-playground ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
src/components/ToggleDarkMode.tsx
Outdated
| checked={isDarkMode} | ||
| size={80} | ||
| /> | ||
| <div className="toggle-wrapper"> |
There was a problem hiding this comment.
@teja-pola any reason why we have to wrap it inside another div. Is there a way to not use it, you should be wrapping a tag only if there are additional tags getting added. Let me know if you have a solution based on maintainability of the code.
There was a problem hiding this comment.
Hey @Owaiseimdad, I added the <div> wrapper to apply the .toggle-wrapper class, which ensures clicks only inside the actual toggle. Without it, the pointer-events rule in ToggleDarkMode.ts wouldn’t work as intended. However, I understand your concern about unnecessary wrappers. Its just happened as different developers have different practices writing the code. I’ll simplify the structure and make changes while ensuring maintainability of the code now.
There was a problem hiding this comment.
@teja-pola there has to be a way to make sure who ever uses darktoogle anywhere in app, they should not be wrapping it inside the div. Let me see what are the other possibilities.
There was a problem hiding this comment.
@Owaiseimdad Its done. Please review now and ask to merge if everything is up.
f479e8b to
1556dcd
Compare
1a40f95 to
cbd3ebb
Compare
Signed-off-by: Dharma Teja <dteja2468@gmail.com>
DianaLease
left a comment
There was a problem hiding this comment.
Please update with the latest main & resolve conflicts
Signed-off-by: Dharma Teja <dteja2468@gmail.com>
deabded to
e160618
Compare
Signed-off-by: Dharma Teja <dteja2468@gmail.com>
Signed-off-by: Dharma Teja <dteja2468@gmail.com>
Signed-off-by: Dharma Teja <dteja2468@gmail.com>
Signed-off-by: Dharma Teja <dteja2468@gmail.com>
Signed-off-by: Dharma Teja <dteja2468@gmail.com>
Signed-off-by: Dharma Teja <dteja2468@gmail.com>
Signed-off-by: Dharma Teja <dteja2468@gmail.com>
e160618 to
4437a4e
Compare
|
@DianaLease updated to latest main, can you merge now |
* fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> * fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> * fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> * fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> * fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> * fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> * fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> * fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> * fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> --------- Signed-off-by: Dharma Teja <dteja2468@gmail.com>
* fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> * fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> * fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> * fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> * fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> * fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> * fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> * fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> * fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> --------- Signed-off-by: Dharma Teja <dteja2468@gmail.com> Signed-off-by: surya4419 <suryaa4419@gmail.com>
* fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> * fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> * fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> * fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> * fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> * fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> * fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> * fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> * fix(button): fix dark mode toggle click - I201 Signed-off-by: Dharma Teja <dteja2468@gmail.com> --------- Signed-off-by: Dharma Teja <dteja2468@gmail.com> Signed-off-by: Owaise Imdad <owaiseimdad@gmail.com>
Closes #201
Fixes an issue where clicking on the outer container of the dark mode toggle unintentionally triggers the mode change. Now, only direct clicks on the button will toggle dark mode.
Changes
Fixed event listener placement to ensure only button clicks trigger dark mode.
Updated the ToggleDarkMode.tsx component to prevent unintended toggling.
Improved accessibility and UX by making the toggle interaction more precise.
Flags
n/a
Screenshots or Video
BEFORE
Untitled.video.-.Made.with.Clipchamp.2.mp4
AFTER
Untitled.video.-.Made.with.Clipchamp.3.mp4
Related Issues
Author Checklist
--signoffoption of git commit.mainfromfork:branchname