Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Improve story

dominik-zeglen8b38f83e04bd
diff --git a/saleor/static/dashboard-next/storybook/stories/components/MultiSelectField.tsx b/saleor/static/dashboard-next/storybook/stories/components/MultiSelectField.tsx
index 349ce4041f..f9896c78b7 100644
--- a/saleor/static/dashboard-next/storybook/stories/components/MultiSelectField.tsx
+++ b/saleor/static/dashboard-next/storybook/stories/components/MultiSelectField.tsx
@@ -2,6 +2,9 @@ import { storiesOf } from "@storybook/react";
import * as React from "react";
import MultiSelectField from "../../../components/MultiSelectField";
+import CardDecorator from "../../CardDecorator";
+import Decorator from "../../Decorator";
+import Form from "../../../components/Form";
const choices = [
{ value: "1", label: "Apparel" },
@@ -11,6 +14,8 @@ const choices = [
];
storiesOf("Generics / MultiSelectField", module)
+ .addDecorator(CardDecorator)
+ .addDecorator(Decorator)
.add("with no value", () => (
<MultiSelectField choices={choices} onChange={undefined} />
))
@@ -59,4 +64,18 @@ storiesOf("Generics / MultiSelectField", module)
hint="Lorem error"
error={true}
/>
+ ))
+ .add("interactive", () => (
+ <Form initial={{ data: [choices[0].value] }}>
+ {({ change, data }) => (
+ <MultiSelectField
+ choices={choices}
+ onChange={change}
+ value={data.data}
+ label="Lorem"
+ hint="Ipsum"
+ name="data"
+ />
+ )}
+ </Form>
));