From 9b52bd50d9dee612319250fc8ef0c23b53978fc7 Mon Sep 17 00:00:00 2001 From: Chaim Lev-Ari Date: Sun, 3 Sep 2023 10:26:33 +0100 Subject: [PATCH] fix(ui/switch): reduce label size [EE-3803] (#10018) --- .../form-components/SwitchField/SwitchField.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/react/components/form-components/SwitchField/SwitchField.tsx b/app/react/components/form-components/SwitchField/SwitchField.tsx index 0bd13d008..d8f9d783d 100644 --- a/app/react/components/form-components/SwitchField/SwitchField.tsx +++ b/app/react/components/form-components/SwitchField/SwitchField.tsx @@ -1,5 +1,6 @@ import clsx from 'clsx'; import { ComponentProps } from 'react'; +import uuid from 'uuid'; import { FeatureId } from '@/react/portainer/feature-flags/enums'; @@ -30,7 +31,7 @@ export function SwitchField({ checked, label, index, - name, + name = uuid(), labelClass, fieldClass, dataCy, @@ -43,15 +44,16 @@ export function SwitchField({ const toggleName = name ? `toggle_${name}` : ''; return ( - - + ); }