diff --git a/x-pack/plugins/observability/public/pages/slo_edit/components/slo_edit_form_objective_section.tsx b/x-pack/plugins/observability/public/pages/slo_edit/components/slo_edit_form_objective_section.tsx index 23c73b302b73a..951e879f43cf1 100644 --- a/x-pack/plugins/observability/public/pages/slo_edit/components/slo_edit_form_objective_section.tsx +++ b/x-pack/plugins/observability/public/pages/slo_edit/components/slo_edit_form_objective_section.tsx @@ -241,17 +241,17 @@ export function SloEditFormObjectiveSection() { min: 0.001, max: 99.999, }} - render={({ field: { ref, ...field }, fieldState }) => ( + render={({ field: { ref, onChange, ...field }, fieldState }) => ( field.onChange(Number(event.target.value))} + onChange={(event) => onChange(event.target.value)} /> )} /> diff --git a/x-pack/plugins/observability/public/pages/slo_edit/components/slo_edit_form_objective_section_timeslices.tsx b/x-pack/plugins/observability/public/pages/slo_edit/components/slo_edit_form_objective_section_timeslices.tsx index bdc8b15d46923..2d2648290ba8a 100644 --- a/x-pack/plugins/observability/public/pages/slo_edit/components/slo_edit_form_objective_section_timeslices.tsx +++ b/x-pack/plugins/observability/public/pages/slo_edit/components/slo_edit_form_objective_section_timeslices.tsx @@ -43,17 +43,17 @@ export function SloEditFormObjectiveSectionTimeslices() { min: 0.001, max: 99.999, }} - render={({ field: { ref, ...field }, fieldState }) => ( + render={({ field: { ref, onChange, ...field }, fieldState }) => ( field.onChange(Number(event.target.value))} + onChange={(event) => onChange(event.target.value)} /> )} /> @@ -82,17 +82,17 @@ export function SloEditFormObjectiveSectionTimeslices() { defaultValue="1" control={control} rules={{ required: true, min: 1, max: 120 }} - render={({ field: { ref, ...field }, fieldState }) => ( + render={({ field: { ref, onChange, ...field }, fieldState }) => ( field.onChange(String(Number(event.target.value)))} + onChange={(event) => onChange(String(parseInt(event.target.value, 10)))} /> )} />