From 9d54c6b27e27d97c9343e12f3473158b8dfafb4a Mon Sep 17 00:00:00 2001 From: frodehansen2 Date: Thu, 12 Dec 2024 11:09:15 +0100 Subject: [PATCH] Fjerne required prop --- .../formik-checkbox-group/FormikCheckboxGroup.tsx | 2 ++ .../src/components/formik-checkbox/FormikCheckbox.tsx | 2 ++ .../FormikConfirmationCheckbox.tsx | 2 ++ .../components/formik-country-select/CountrySelect.tsx | 8 +++++++- .../formik-country-select/FormikCountrySelect.tsx | 2 ++ .../src/components/formik-datepicker/FormikDatepicker.tsx | 2 ++ .../components/formik-input-group/FormikInputGroup.tsx | 2 ++ .../components/formik-number-input/FormikNumberInput.tsx | 2 ++ .../components/formik-radio-group/FormikRadioGroup.tsx | 2 ++ .../src/components/formik-select/FormikSelect.tsx | 2 ++ .../src/components/formik-text-field/FormikTextField.tsx | 2 ++ .../src/components/formik-textarea/FormikTextarea.tsx | 2 ++ .../src/components/formik-time-input/FormikTimeInput.tsx | 2 ++ .../formik-yes-or-no-question/FormikYesOrNoQuestion.tsx | 2 ++ .../sif-common-formik-ds/src/utils/inputPropsToRemove.ts | 8 ++++++++ .../stories/components/FormikRadioGroup.stories.tsx | 1 + .../stories/components/FormikTextField.stories.tsx | 1 + 17 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 packages/sif-common-formik-ds/src/utils/inputPropsToRemove.ts diff --git a/packages/sif-common-formik-ds/src/components/formik-checkbox-group/FormikCheckboxGroup.tsx b/packages/sif-common-formik-ds/src/components/formik-checkbox-group/FormikCheckboxGroup.tsx index eaf5165df2..54670985c7 100644 --- a/packages/sif-common-formik-ds/src/components/formik-checkbox-group/FormikCheckboxGroup.tsx +++ b/packages/sif-common-formik-ds/src/components/formik-checkbox-group/FormikCheckboxGroup.tsx @@ -4,6 +4,7 @@ import { FastField, Field, FieldProps } from 'formik'; import { TestProps, TypedFormInputValidationProps, UseFastFieldProps } from '../../types'; import { getErrorPropForFormikInput } from '../../utils/typedFormErrorUtils'; import { TypedFormikFormContext } from '../typed-formik-form/TypedFormikForm'; +import { inputPropsToRemove } from '../../utils/inputPropsToRemove'; export type FormikCheckboxGroupCheckboxProp = Omit & { label: React.ReactNode; @@ -48,6 +49,7 @@ function FormikCheckboxGroup({ return ( extends Omit { name: FieldName; @@ -36,6 +37,7 @@ function FormikCheckbox({ extends Omit { name: FieldName; @@ -28,6 +29,7 @@ function FormikConfirmationCheckbox({ { diff --git a/packages/sif-common-formik-ds/src/components/formik-country-select/CountrySelect.tsx b/packages/sif-common-formik-ds/src/components/formik-country-select/CountrySelect.tsx index 2bcd300574..3b9adfe38f 100644 --- a/packages/sif-common-formik-ds/src/components/formik-country-select/CountrySelect.tsx +++ b/packages/sif-common-formik-ds/src/components/formik-country-select/CountrySelect.tsx @@ -2,6 +2,7 @@ import React from 'react'; import { getCountries } from '../../utils/countryUtils'; import { TestProps } from '../../types'; import { Select, SelectProps } from '@navikt/ds-react'; +import { inputPropsToRemove } from '../../utils/inputPropsToRemove'; interface Props extends TestProps, Omit { label: React.ReactNode; @@ -56,7 +57,12 @@ class CountrySelect extends React.Component { // eslint-disable-next-line @typescript-eslint/no-unused-vars const { onChange, name, showOnlyEuAndEftaCountries, locale, ...restProps } = this.props; return ( - onChange(e.target.value)} + autoComplete="off">