-
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(SelectInputV2): auto scroll (#4282)
* fix: selectinputv2 auto scroll * fix: remove useEffect * fix: tests
- Loading branch information
Showing
9 changed files
with
80 additions
and
2 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 | ||
--- | ||
|
||
`<SelectInputV2 />`: auto scroll when the component is at the bottom of the page |
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
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
41 changes: 41 additions & 0 deletions
41
packages/ui/src/components/SelectInputV2/__stories__/Modal.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,41 @@ | ||
import type { StoryFn } from '@storybook/react' | ||
import { SelectInputV2 } from '..' | ||
import { Button } from '../../Button' | ||
import { Modal as ModalComponent } from '../../Modal' | ||
import { dataGrouped } from './resources' | ||
|
||
export const Modal: StoryFn<typeof SelectInputV2> = args => ( | ||
<ModalComponent | ||
disclosure={<Button type="button">Modal</Button>} | ||
placement="bottom" | ||
> | ||
<SelectInputV2 {...args} label="Label" /> | ||
</ModalComponent> | ||
) | ||
|
||
Modal.args = { | ||
options: dataGrouped, | ||
multiselect: true, | ||
name: 'example', | ||
placeholder: 'Select item', | ||
placeholderSearch: 'Search in list', | ||
searchable: true, | ||
disabled: false, | ||
helper: 'helper', | ||
} | ||
Modal.decorators = [ | ||
StoryComponent => ( | ||
<div style={{ height: '80px' }}> | ||
<StoryComponent /> | ||
</div> | ||
), | ||
] | ||
|
||
Modal.parameters = { | ||
docs: { | ||
description: { | ||
story: | ||
'The component will trigger an automatic scroll when it is located at the bottom of the screen', | ||
}, | ||
}, | ||
} |
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
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