Skip to content

Commit fc97673

Browse files
committed
generate id to allow spaces
1 parent be7bd6f commit fc97673

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/drafts/SelectPanel2/stories/SelectPanel.examples.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ const CreateNewLabelDialog = ({
817817
const {name, color, description} = Object.fromEntries(formData) as Record<string, string>
818818

819819
// pretending to persist changes
820-
const id = `new-${name}`
820+
const id = Math.random().toString(26).slice(6)
821821
data.labels.unshift({id, name, color, description})
822822
onSave(id)
823823
}
@@ -828,7 +828,7 @@ const CreateNewLabelDialog = ({
828828
onClose={onCancel}
829829
width="medium"
830830
footerButtons={[
831-
{buttonType: 'default', content: 'Cancel', onClick: () => setDialogOpen(false)},
831+
{buttonType: 'default', content: 'Cancel', onClick: onCancel},
832832
{type: 'submit', buttonType: 'primary', content: 'Save', onClick: () => formSubmitRef.current?.click()},
833833
]}
834834
>

0 commit comments

Comments
 (0)