Skip to content

Commit

Permalink
chore: fix prop name in options control (appsmithorg#37130)
Browse files Browse the repository at this point in the history
/ok-to-test tags="@tag.Widget"

The options control was using `options` as the property name for the
options array even when thee prop name was not `options`. This was
causing issues when the property name was different.

<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/11590623056>
> Commit: 1e16edb
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11590623056&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Widget`
> Spec:
> <hr>Wed, 30 Oct 2024 11:11:49 UTC
<!-- end of auto-generated comment: Cypress test results  -->


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Enhanced the `OptionControl` component to support dynamic property
updates based on component props.

- **Bug Fixes**
- Improved the handling of property updates, allowing for more flexible
and accurate updates.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
jsartisan authored Oct 30, 2024
1 parent b8a238f commit 6e31579
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/propertyControls/OptionControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class OptionControl extends BaseControl<ControlProps> {
options: SegmentedControlOption[],
isUpdatedViaKeyboard = false,
) => {
this.updateProperty("options", options, isUpdatedViaKeyboard);
this.updateProperty(this.props.propertyName, options, isUpdatedViaKeyboard);
};

static getControlType() {
Expand Down

0 comments on commit 6e31579

Please sign in to comment.