Skip to content

Commit

Permalink
fix: borderBoxSize not available in older browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Feb 6, 2023
1 parent 1c772c5 commit 8f90971
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/vue-virtual-scroller/src/components/DynamicScroller.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,17 @@ export default {
}
for (const entry of entries) {
if (entry.target && entry.target.$_vs_onResize) {
const resizeObserverSize = entry.borderBoxSize[0]
entry.target.$_vs_onResize(entry.target.$_vs_id, resizeObserverSize.inlineSize, resizeObserverSize.blockSize)
let width, height
if (entry.borderBoxSize) {
const resizeObserverSize = entry.borderBoxSize[0]
width = resizeObserverSize.inlineSize
height = resizeObserverSize.blockSize
} else {
// @TODO remove when contentRect is deprecated
width = entry.contentRect.width
height = entry.contentRect.height
}
entry.target.$_vs_onResize(entry.target.$_vs_id, width, height)
}
}
})
Expand Down

0 comments on commit 8f90971

Please sign in to comment.