Skip to content

Commit

Permalink
fix(core): affix dislocation
Browse files Browse the repository at this point in the history
  • Loading branch information
chizukicn committed Nov 14, 2023
1 parent 580ef36 commit ad8430a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/core/src/affix/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,19 @@ export const useAffix = defineHookComponent({
if (!wrapperRef.value || !containerRef.value) {
return;
}
const targetRect = getTargetRect(containerRef.value);
let newIsFixed = false;
let newFixedStyles = {};
const area = wrapperRect.width * wrapperRect.height;
if (area === 0) {
return;
}
const newPlaceholderStyles: CSSProperties = {
width: px(wrapperRect.width),
height: px(wrapperRect.height)
};

const targetRect = getTargetRect(containerRef.value);
let newIsFixed = false;
let newFixedStyles = {};

const offset = props.offset;

if (props.position === "top") {
Expand Down

0 comments on commit ad8430a

Please sign in to comment.