From 04918ec3d27bba9a38b900b4d10df2060588241e Mon Sep 17 00:00:00 2001 From: Luuk Peters Date: Sun, 9 Nov 2025 22:38:16 +0100 Subject: [PATCH] Slider property editor: Fix for preset value handling of `enableRange` (#20772) Fix config value access in UmbSliderPropertyValuePreset Updated the `UmbSliderPropertyValuePreset` class to ensure the `.value` property is accessed for configuration items. This change improves the accuracy of retrieving `enableRange`, `min`, `max`, and `step` values, addressing potential bugs in value processing. Co-authored-by: Luuk Peters --- .../slider/slider-property-value-preset.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/property-editors/slider/slider-property-value-preset.ts b/src/Umbraco.Web.UI.Client/src/packages/property-editors/slider/slider-property-value-preset.ts index 8c27b41147..acbec3f810 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/property-editors/slider/slider-property-value-preset.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/property-editors/slider/slider-property-value-preset.ts @@ -6,16 +6,16 @@ export class UmbSliderPropertyValuePreset implements UmbPropertyValuePreset { async processValue(value: undefined | UmbSliderPropertyEditorUiValue, config: UmbPropertyEditorConfig) { - const enableRange = Boolean(config.find((x) => x.alias === 'enableRange') ?? false); + const enableRange = Boolean(config.find((x) => x.alias === 'enableRange')?.value ?? false); /* - const min = Number(config.find((x) => x.alias === 'minVal') ?? 0); - const max = Number(config.find((x) => x.alias === 'maxVal') ?? 100); + const min = Number(config.find((x) => x.alias === 'minVal')?.value ?? 0); + const max = Number(config.find((x) => x.alias === 'maxVal')?.value ?? 100); const minVerified = isNaN(min) ? undefined : min; const maxVerified = isNaN(max) ? undefined : max; */ - const step = (config.find((x) => x.alias === 'step') as number | undefined) ?? 0; + const step = Number(config.find((x) => x.alias === 'step')?.value ?? 0); const stepVerified = step > 0 ? step : 1; const initValueMin = Number(config.find((x) => x.alias === 'initVal1')?.value) || 0;