diff --git a/src/components/ComponentConfiguration.stories.tsx b/src/components/ComponentConfiguration.stories.tsx index a234e307..7f3184e0 100644 --- a/src/components/ComponentConfiguration.stories.tsx +++ b/src/components/ComponentConfiguration.stories.tsx @@ -2314,9 +2314,6 @@ export const ProductPrice: Story = { const preview = within(canvas.getByTestId('componentPreview')); await expect(canvas.getByLabelText('Label')).toHaveValue('A productPrice field'); - await waitFor(async () => { - await expect(canvas.getByLabelText('Property Name')).toHaveValue('aProductPriceField'); - }); await expect(canvas.getByLabelText('Description')).toHaveValue(''); await expect(canvas.getByLabelText('Tooltip')).toHaveValue(''); await expect(canvas.getByLabelText('Show in summary')).toBeChecked(); @@ -2329,16 +2326,9 @@ export const ProductPrice: Story = { await userEvent.type(canvas.getByLabelText('Label'), 'Updated preview label'); await expect(await preview.findByText('Updated preview label')).toBeVisible(); - // Ensure that the manually entered key is kept instead of derived from the label, - // even when key/label components are not mounted. - const keyInput = canvas.getByLabelText('Property Name'); - // fireEvent is deliberate, as userEvent.clear + userEvent.type briefly makes the field - // not have any value, which triggers the generate-key-from-label behaviour. - fireEvent.change(keyInput, {target: {value: 'customKey'}}); await userEvent.click(canvas.getByRole('tab', {name: 'Basic'})); await userEvent.clear(canvas.getByLabelText('Label')); await userEvent.type(canvas.getByLabelText('Label'), 'Other label', {delay: 50}); - await expect(canvas.getByLabelText('Property Name')).toHaveDisplayValue('customKey'); await step('Submit form', async () => { await userEvent.click(canvas.getByRole('button', {name: 'Save'})); diff --git a/src/registry/productPrice/edit.tsx b/src/registry/productPrice/edit.tsx index e4c88e33..a9269144 100644 --- a/src/registry/productPrice/edit.tsx +++ b/src/registry/productPrice/edit.tsx @@ -7,7 +7,6 @@ import { Description, Hidden, IsSensitiveData, - Key, Label, PresentationConfig, Registration, @@ -15,7 +14,6 @@ import { Tooltip, Translations, Validate, - useDeriveComponentKey, } from '@/components/builder'; import {LABELS} from '@/components/builder/messages'; import {TabList, TabPanel, Tabs} from '@/components/formio'; @@ -28,7 +26,6 @@ import {EditFormDefinition} from '../types'; */ const EditForm: EditFormDefinition = () => { const intl = useIntl(); - const [isKeyManuallySetRef, generatedKey] = useDeriveComponentKey(); const {hasAnyError} = useErrorChecker(); Validate.useManageValidatorsTranslations(['required']); @@ -58,7 +55,6 @@ const EditForm: EditFormDefinition = () => { {/* Basic tab */}