Skip to content

Commit ea0b3c6

Browse files
andreas-schultzhaschek
authored andcommitted
Improve story for MultiSelect
1 parent 4f47713 commit ea0b3c6

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/components/MultiSuggestField/MultiSuggestField.stories.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { Meta, StoryFn } from "@storybook/react";
55
import { fn } from "@storybook/test";
66

77
import { helpersArgTypes } from "../../../.storybook/helpers";
8+
import { Notification } from "../Notification/Notification";
9+
import Spacing from "../Separation/Spacing";
810

911
import { MultiSuggestField, MultiSuggestFieldSelectionProps, SimpleDialog } from "./../../../index";
1012

@@ -273,12 +275,12 @@ const SelectionNotificationComponent = (): React.JSX.Element => {
273275
} else if (params.newlyRemoved) {
274276
setNotification(`Element removed: ${params.newlyRemoved}`);
275277
}
276-
277-
setTimeout(() => setNotification(null), 3000);
278278
}, []);
279279

280280
return (
281281
<OverlaysProvider>
282+
{notification && <Notification intent={"info"}>{notification}</Notification>}
283+
<Spacing size={"medium"} />
282284
<MultiSuggestField<string>
283285
items={availableItems}
284286
prePopulateWithItems={true}
@@ -287,9 +289,6 @@ const SelectionNotificationComponent = (): React.JSX.Element => {
287289
itemLabel={identity}
288290
createNewItemFromQuery={identity}
289291
/>
290-
{notification && (
291-
<Notification >{notification}</Notification>
292-
)}
293292
</OverlaysProvider>
294293
);
295294
};

0 commit comments

Comments
 (0)