Skip to content

[Bug]: .isSwitched of a Switch-widget doesn't get the correct (updates) value (#41566) #41706

@Arbab1308

Description

@Arbab1308

Is there an existing issue for this?

  • I have searched the existing issues

Description

Stack: React / Redux / Data Tree (Frontend)

Steps To Reproduce

Implementation Logic:

Locate the Event Handler: Go to SwitchWidget/widget/index.tsx and find the onChange event handler that fires when a user clicks the toggle.

Check the Dispatch: The widget communicates with the global state using a function like super.updateWidgetMetaProperty('isSwitched', newValue).

The Fix: The bug implies the property is either not being updated, or it's dispatching a "stale" state (e.g., using a closure that captured the old isSwitched value instead of the new one). Ensure the onChange event captures the exact boolean from the synthetic event (e.g., event.target.checked) and pushes that exact value to updateWidgetMetaProperty, rather than relying on !props.isSwitched.

Public Sample App

No response

Environment

Production

Severity

Low (Cosmetic UI issues)

Issue video log

No response

Version

Cloud / Self Hosted 1.6.6

Metadata

Metadata

Labels

BugSomething isn't workingNeeds TriagingNeeds attention from maintainers to triage

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions