diff --git a/.changeset/curvy-rings-relate.md b/.changeset/curvy-rings-relate.md new file mode 100644 index 00000000000..668ef18c96c --- /dev/null +++ b/.changeset/curvy-rings-relate.md @@ -0,0 +1,6 @@ +--- +'@keystone-ui/segmented-control': patch +'@keystone-6/core': patch +--- + +Fixes creating new relationships in card view on create item page diff --git a/design-system/packages/segmented-control/src/SegmentedControl.tsx b/design-system/packages/segmented-control/src/SegmentedControl.tsx index 678e92eedfe..cc0a967cac7 100644 --- a/design-system/packages/segmented-control/src/SegmentedControl.tsx +++ b/design-system/packages/segmented-control/src/SegmentedControl.tsx @@ -146,6 +146,7 @@ export const SegmentedControl = ({ {}} checked={nothingIsSelected} disabled={actuallyDisabled} value="none" diff --git a/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage/index.tsx b/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage/index.tsx index fdbc5692b2c..8a15a043e42 100644 --- a/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage/index.tsx +++ b/packages/core/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage/index.tsx @@ -25,27 +25,22 @@ function CreatePageForm(props: { list: ListMeta }) { /> )} -
{ - event.preventDefault(); - const item = await createItem.create(); - if (item) { - router.push(`/${props.list.path}/${item.id}`); - } - }} - > - - - - - + + + + ); } diff --git a/tests/admin-ui-tests/navigation.test.ts b/tests/admin-ui-tests/navigation.test.ts index 6cd5b3bc552..40ba4410871 100644 --- a/tests/admin-ui-tests/navigation.test.ts +++ b/tests/admin-ui-tests/navigation.test.ts @@ -58,7 +58,7 @@ adminUITests('./tests/test-projects/basic', browserType => { await page.goto('http://localhost:3000'); await page.click('a[title="Create Task"]'); await page.fill('id=label', 'Test Task'); - await Promise.all([page.waitForNavigation(), page.click('button[type="submit"]')]); + await Promise.all([page.waitForNavigation(), page.click('button:has-text("Create Task")')]); await page.hover('nav a:has-text("Tasks")'); const element = await page.waitForSelector('nav a:has-text("Tasks")'); const ariaCurrent = await element?.getAttribute('aria-current');