-
-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Area cal should skip static parent (#352)
* refactor: extract area cal * docs: add demo * chore: align fix * test: fin test case
- Loading branch information
Showing
6 changed files
with
227 additions
and
37 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,8 @@ | ||
--- | ||
title: Static Scroll | ||
nav: | ||
title: Demo | ||
path: /demo | ||
--- | ||
|
||
<code src="../examples/static-scroll.tsx"></code> |
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,64 @@ | ||
/* eslint no-console:0 */ | ||
import Trigger from 'rc-trigger'; | ||
import React from 'react'; | ||
import '../../assets/index.less'; | ||
import { builtinPlacements } from './inside'; | ||
|
||
export default () => { | ||
return ( | ||
<React.StrictMode> | ||
<div | ||
style={{ | ||
background: 'rgba(0, 0, 255, 0.1)', | ||
margin: `64px`, | ||
height: 200, | ||
overflow: 'auto', | ||
// Must have for test | ||
position: 'static', | ||
}} | ||
> | ||
<Trigger | ||
arrow | ||
popup={ | ||
<div | ||
style={{ | ||
background: 'yellow', | ||
border: '1px solid blue', | ||
width: 200, | ||
height: 60, | ||
opacity: 0.9, | ||
}} | ||
> | ||
Popup | ||
</div> | ||
} | ||
popupStyle={{ boxShadow: '0 0 5px red' }} | ||
popupVisible | ||
builtinPlacements={builtinPlacements} | ||
popupPlacement="top" | ||
stretch="minWidth" | ||
getPopupContainer={(e) => e.parentElement!} | ||
> | ||
<span | ||
style={{ | ||
background: 'green', | ||
color: '#FFF', | ||
paddingBlock: 30, | ||
paddingInline: 70, | ||
opacity: 0.9, | ||
transform: 'scale(0.6)', | ||
display: 'inline-block', | ||
}} | ||
> | ||
Target | ||
</span> | ||
</Trigger> | ||
{new Array(20).fill(null).map((_, index) => ( | ||
<h1 key={index} style={{ width: '200vw' }}> | ||
Placeholder Line {index} | ||
</h1> | ||
))} | ||
</div> | ||
</React.StrictMode> | ||
); | ||
}; |
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