-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Modal): remove unecessary stop propagation
- Loading branch information
1 parent
8bc5a6e
commit 121262b
Showing
4 changed files
with
53 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@ultraviolet/ui": patch | ||
--- | ||
|
||
Fix `<Modal />` stop propagation so you can close `<SelectInputV2 />` within it |
39 changes: 39 additions & 0 deletions
39
packages/ui/src/components/Modal/__stories__/WithSelectInput.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import type { StoryFn } from '@storybook/react' | ||
import { Modal } from '..' | ||
import { Button } from '../../Button' | ||
import { SelectInputV2 } from '../../SelectInputV2' | ||
|
||
const OPTIONS = [ | ||
{ | ||
label: 'Option 1', | ||
value: 'option-1', | ||
}, | ||
{ | ||
label: 'Option 2', | ||
value: 'option-2', | ||
}, | ||
{ | ||
label: 'Option 3', | ||
value: 'option-3', | ||
}, | ||
] | ||
|
||
export const WithSelectInput: StoryFn = props => ( | ||
<Modal disclosure={<Button>Open Modal with SelectInput</Button>} {...props}> | ||
<div style={{ display: 'flex', flexDirection: 'column', gap: 32 }}> | ||
<SelectInputV2 | ||
label="Choose an option" | ||
name="example" | ||
options={OPTIONS} | ||
/> | ||
</div> | ||
</Modal> | ||
) | ||
WithSelectInput.parameters = { | ||
docs: { | ||
description: { | ||
story: | ||
'Having a select input inside a modal is a common use case and shows you how to modal and select input can work together.', | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters