diff --git a/src/Umbraco.Web.UI.Client/src/packages/property-editors/slider/Umbraco.Slider.ts b/src/Umbraco.Web.UI.Client/src/packages/property-editors/slider/Umbraco.Slider.ts index 7ba6fe838683..1466afce1102 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/property-editors/slider/Umbraco.Slider.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/property-editors/slider/Umbraco.Slider.ts @@ -12,18 +12,20 @@ export const manifest: ManifestPropertyEditorSchema = { alias: 'minVal', label: 'Minimum value', description: '', - propertyEditorUiAlias: 'Umb.PropertyEditorUi.Integer', + propertyEditorUiAlias: 'Umb.PropertyEditorUi.Decimal', + config: [{ alias: 'step', value: '0.001' }], }, { alias: 'maxVal', label: 'Maximum value', description: '', - propertyEditorUiAlias: 'Umb.PropertyEditorUi.Integer', + propertyEditorUiAlias: 'Umb.PropertyEditorUi.Decimal', + config: [{ alias: 'step', value: '0.001' }], }, ], defaultData: [ - { alias: 'minVal', value: 0 }, - { alias: 'maxVal', value: 100 }, + { alias: 'minVal', value: 0.0 }, + { alias: 'maxVal', value: 100.0 }, ], }, }, diff --git a/src/Umbraco.Web.UI.Client/src/packages/property-editors/slider/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/property-editors/slider/manifests.ts index d313ac784957..55683fe11e04 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/property-editors/slider/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/property-editors/slider/manifests.ts @@ -31,33 +31,36 @@ export const manifests: Array = [ alias: 'initVal1', label: 'Initial value', description: '', - propertyEditorUiAlias: 'Umb.PropertyEditorUi.Integer', + propertyEditorUiAlias: 'Umb.PropertyEditorUi.Decimal', + config: [{ alias: 'step', value: '0.001' }], }, { alias: 'initVal2', label: 'Initial value 2', description: 'Used when range is enabled', - propertyEditorUiAlias: 'Umb.PropertyEditorUi.Integer', + propertyEditorUiAlias: 'Umb.PropertyEditorUi.Decimal', + config: [{ alias: 'step', value: '0.001' }], }, { alias: 'step', label: 'Step increments', description: '', - propertyEditorUiAlias: 'Umb.PropertyEditorUi.Integer', + propertyEditorUiAlias: 'Umb.PropertyEditorUi.Decimal', + config: [{ alias: 'step', value: '0.001' }], }, ], defaultData: [ { alias: 'initVal1', - value: 0, + value: 0.0, }, { alias: 'initVal2', - value: 0, + value: 0.0, }, { alias: 'step', - value: 1, + value: 1.0, }, ], }, diff --git a/src/Umbraco.Web.UI.Client/src/packages/property-editors/slider/property-editor-ui-slider.element.ts b/src/Umbraco.Web.UI.Client/src/packages/property-editors/slider/property-editor-ui-slider.element.ts index 9cef6edb21b1..0545f874eea9 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/property-editors/slider/property-editor-ui-slider.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/property-editors/slider/property-editor-ui-slider.element.ts @@ -108,8 +108,8 @@ export class UmbPropertyEditorUISliderElement const initVal2 = Number(config.getValueByAlias('initVal2')); this._initVal2 = isNaN(initVal2) ? this._initVal1 + this._step : initVal2; - this._min = this.#parseInt(config.getValueByAlias('minVal')) || 0; - this._max = this.#parseInt(config.getValueByAlias('maxVal')) || 100; + this._min = this.#parseNumber(config.getValueByAlias('minVal')) || 0; + this._max = this.#parseNumber(config.getValueByAlias('maxVal')) || 100; if (this._min === this._max) { this._max = this._min + 100; @@ -137,9 +137,9 @@ export class UmbPropertyEditorUISliderElement } } - #parseInt(input: unknown): number | undefined { + #parseNumber(input: unknown): number | undefined { const num = Number(input); - return Number.isNaN(num) ? undefined : num; + return Number.isFinite(num) ? undefined : num; } #onChange(event: CustomEvent & { target: UmbInputSliderElement }) {