fix: #6397 - Inconsistent feature toggle behavior corrected - #6601
Merged
Conversation
Inconsistent feature toggle behavior fixed by preventing event bubbling
|
@Mythindia is attempting to deploy a commit to the Flagsmith Team on Vercel. A member of the Team first needs to authorize it. |
talissoncosta
requested changes
Jan 27, 2026
talissoncosta
left a comment
Contributor
There was a problem hiding this comment.
Thanks for your contribution. I've just added a minor comment.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
talissoncosta
approved these changes
Jan 30, 2026
talissoncosta
left a comment
Contributor
There was a problem hiding this comment.
Looks good, thanks so much for your contribution!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Inconsistent feature toggle behavior fixed by preventing event bubbling
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Closes #6397
Inconsistent feature toggle behavior based on window size
Description:
Full-width screens: Clicking the feature toggle switch displays a confirmation modal (correct behavior)
Narrow screens: Clicking the feature toggle switch opens the feature detail view instead of showing the confirmation modal (incorrect behavior)
Root Cause:
The feature flag list component (FeatureRow.tsx) had two responsive rendering branches:
Large screens (d-lg-flex): The toggle Switch was properly wrapped with onClick={(e) => { e.stopPropagation() }} to prevent event bubbling
Narrow screens (d-lg-none): The toggle Switch was missing this event propagation blocker
When users clicked the toggle on narrow screens, the click event bubbled up to the parent row's onClick={() => editFeature()} handler, which opened the feature detail view instead of allowing the toggle confirmation modal to appear.
Solution
Event Propagation Handler (FeatureRow.tsx)
Added onClick={(e) => { e.stopPropagation() }} wrapper around the narrow-screen Switch component to prevent click events from bubbling to the parent row's click handler.
How did you test this code?
Open your browser (in my case chromium-based) at half-width
Click the toggle to enable/disable a feature in the dashboard
Notice how it opens the feature in a new view