Skip to content

Commit

Permalink
delint
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjbradshaw committed Sep 11, 2024
1 parent b1d9409 commit 1ab3e34
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/child/overflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,17 @@ const overflowObserver = (options) => {
onChange(overflowedNodeList)
}

// const emitAfterReflow = () => requestAnimationFrame(emit)
const emitAfterReflow = () => requestAnimationFrame(emit)

function callback(entries) {
console.log('callback', entries)
for (const entry of entries) {
const { boundingClientRect, rootBounds, target } = entry
const edge = boundingClientRect[side]
const hasOverflow = edge === 0 || edge > rootBounds[side]
target.toggleAttribute(OVERFLOW_ATTR, hasOverflow)
}

emit()
emitAfterReflow()
}

const observer = new IntersectionObserver(callback, observerOptions)
Expand Down

0 comments on commit 1ab3e34

Please sign in to comment.