-
Notifications
You must be signed in to change notification settings - Fork 591
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(*): pagination dropdown position
- add scroll when calculating element location - add popup props to pagination to set dropdown align
- Loading branch information
Showing
7 changed files
with
102 additions
and
3 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
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,81 @@ | ||
# 每页显示 | ||
|
||
- order: 9 | ||
|
||
使用`popupProps` prop中的`align`属性设置下拉位置。 | ||
|
||
:::lang=en-us | ||
# Every Page Display | ||
|
||
- order: 9 | ||
|
||
Set dropdown location using `align` property in `popupProps` prop. | ||
|
||
::: | ||
--- | ||
|
||
````jsx | ||
import { Pagination } from '@alifd/next'; | ||
|
||
const handlePageSizeChange = size => console.log(size); | ||
|
||
const containerStyle = { | ||
height: '300px', | ||
padding: 0, | ||
width: '100%', | ||
}; | ||
|
||
const boxStyle = { | ||
overflow: 'auto', | ||
position: 'relative', | ||
width: '100%', | ||
height: '200px', | ||
border: '1px solid black' | ||
}; | ||
|
||
const tempStyle = { | ||
height: '200px', | ||
display: 'flex', | ||
'justify-content': 'center', | ||
'align-items': 'center', | ||
}; | ||
|
||
const parentStyle = { | ||
display: 'flex', | ||
'justify-content': 'space-between', | ||
}; | ||
|
||
const popupProps = { | ||
align: 'bl tl' | ||
}; | ||
|
||
ReactDOM.render( | ||
<div> | ||
<h3>default align - 'tl bl'</h3> | ||
<Pagination pageSizeSelector="dropdown" total='10' pageSizePosition="start" onPageSizeChange={handlePageSizeChange}/> | ||
<h3>custom align - 'bl tl'</h3> | ||
<Pagination pageSizeSelector="dropdown" total='10' pageSizePosition="start" onPageSizeChange={handlePageSizeChange} popupProps={popupProps}/> | ||
<h3>Inside parent with "overlflow: auto"</h3> | ||
<div style={containerStyle}> | ||
<div style={boxStyle}> | ||
<div style={tempStyle}>scroll down to see the example</div> | ||
<div style={parentStyle}> | ||
<div> | ||
<h3>default align - 'tl bl'</h3> | ||
<Pagination pageSizeSelector="dropdown" total='10' pageSizePosition="start" onPageSizeChange={handlePageSizeChange}/> | ||
</div> | ||
<div> | ||
<h3>custom align - 'bl tl'</h3> | ||
<Pagination pageSizeSelector="dropdown" total='10' pageSizePosition="start" onPageSizeChange={handlePageSizeChange} popupProps={popupProps}/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div>, | ||
mountNode | ||
); | ||
|
||
|
||
```` | ||
|
||
|
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
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