mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 12:09:14 +08:00
update
This commit is contained in:
parent
a019c0033f
commit
1bdb8e5939
@ -164,7 +164,7 @@ export default class Affix extends React.Component<AffixProps, AffixState> {
|
||||
const targetInnerHeight =
|
||||
(targetNode as Window).innerHeight || (targetNode as HTMLElement).clientHeight;
|
||||
// ref: https://github.com/ant-design/ant-design/issues/13662
|
||||
if (scrollTop > elemOffset.top - (offsetTop as number) - 1 && offsetMode.top) {
|
||||
if (scrollTop >= elemOffset.top - (offsetTop as number) && offsetMode.top) {
|
||||
// Fixed Top
|
||||
const width = elemOffset.width;
|
||||
const top = targetRect.top + (offsetTop as number);
|
||||
@ -179,7 +179,8 @@ export default class Affix extends React.Component<AffixProps, AffixState> {
|
||||
height: elemSize.height,
|
||||
});
|
||||
} else if (
|
||||
scrollTop < elemOffset.top + elemSize.height + (offsetBottom as number) - targetInnerHeight &&
|
||||
scrollTop <=
|
||||
elemOffset.top + elemSize.height + (offsetBottom as number) - targetInnerHeight &&
|
||||
offsetMode.bottom
|
||||
) {
|
||||
// Fixed Bottom
|
||||
|
Loading…
Reference in New Issue
Block a user