From cff531ab6f04662b8668ab1ee6e6d235e40f09b1 Mon Sep 17 00:00:00 2001 From: Pawan Kumar Date: Thu, 6 Mar 2025 17:04:59 +0530 Subject: [PATCH] chore: allow all deleting in OPTION_INPUT control (#39587) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /ok-to-test tags="@tag.Anvil" https://github.com/user-attachments/assets/d2805978-7e58-4d59-9ccf-6774f67b961d ## Summary by CodeRabbit - **New Features** - Added a configurable option in key-value controls that lets users choose whether empty entries are allowed. - Updated behavior for removing entries now adapts based on this setting, offering more flexibility when managing list items and ensuring a more intuitive user experience. > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 783b98ca652d7cdd920b880c738b9273a4a7cb63 > Cypress dashboard. > Tags: `@tag.Anvil` > Spec: >
Thu, 06 Mar 2025 06:10:39 UTC --- .../src/components/propertyControls/KeyValueComponent.tsx | 5 +++-- app/client/src/components/propertyControls/OptionControl.tsx | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/client/src/components/propertyControls/KeyValueComponent.tsx b/app/client/src/components/propertyControls/KeyValueComponent.tsx index 0782403213..1f6fdf02c0 100644 --- a/app/client/src/components/propertyControls/KeyValueComponent.tsx +++ b/app/client/src/components/propertyControls/KeyValueComponent.tsx @@ -56,6 +56,7 @@ interface KeyValueComponentProps { pairs: SegmentedControlOption[]; updatePairs: UpdatePairFunction; addLabel?: string; + allowEmpty?: boolean; } type SegmentedControlOptionWithKey = SegmentedControlOption & { @@ -223,8 +224,8 @@ export function KeyValueComponent(props: KeyValueComponentProps) { />