Skip to content

Commit

Permalink
Merge pull request #317 from inokawa/vue-style
Browse files Browse the repository at this point in the history
Update style of Vue VList to be the same as React
  • Loading branch information
inokawa authored Jan 8, 2024
2 parents 08c16cc + 8e0ebe9 commit 5b7d354
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
2 changes: 2 additions & 0 deletions src/vue/VList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ export const VList = /*#__PURE__*/ defineComponent({
<div
style={{
contain: "content",
overflowAnchor: "none", // opt out browser's scroll anchoring because it will conflict to scroll anchoring of virtualizer
flex: "none", // flex style on parent can break layout
position: "relative",
visibility: "hidden",
width: isHorizontal ? totalSize + "px" : "100%",
Expand Down
34 changes: 17 additions & 17 deletions src/vue/__snapshots__/VList.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`horizontal should render 0 children 1`] = `
style="display: inline-block; overflow-x: auto; contain: strict; width: 100%; height: 100%;"
>
<div
style="contain: content; position: relative; visibility: hidden; width: 0px; height: 100%; min-width: 0; pointer-events: auto;"
style="contain: content; flex: 0 0 auto; position: relative; visibility: hidden; width: 0px; height: 100%; min-width: 0; pointer-events: auto;"
/>
</div>
</div>
Expand All @@ -21,7 +21,7 @@ exports[`horizontal should render 1 children 1`] = `
style="display: inline-block; overflow-x: auto; contain: strict; width: 100%; height: 100%;"
>
<div
style="contain: content; position: relative; visibility: hidden; width: 40px; height: 100%; min-width: 40; pointer-events: auto;"
style="contain: content; flex: 0 0 auto; position: relative; visibility: hidden; width: 40px; height: 100%; min-width: 40; pointer-events: auto;"
>
<div
style="margin: 0px; padding: 0px; position: absolute; height: 100%; top: 0px; left: 0px; visibility: hidden; display: flex;"
Expand All @@ -43,7 +43,7 @@ exports[`horizontal should render 5 children 1`] = `
style="display: inline-block; overflow-x: auto; contain: strict; width: 100%; height: 100%;"
>
<div
style="contain: content; position: relative; visibility: hidden; width: 200px; height: 100%; min-width: 200; pointer-events: auto;"
style="contain: content; flex: 0 0 auto; position: relative; visibility: hidden; width: 200px; height: 100%; min-width: 200; pointer-events: auto;"
>
<div
style="margin: 0px; padding: 0px; position: absolute; height: 100%; top: 0px; left: 0px; visibility: hidden; display: flex;"
Expand Down Expand Up @@ -93,7 +93,7 @@ exports[`horizontal should render 100 children 1`] = `
style="display: inline-block; overflow-x: auto; contain: strict; width: 100%; height: 100%;"
>
<div
style="contain: content; position: relative; visibility: hidden; width: 4000px; height: 100%; min-width: 4000; pointer-events: auto;"
style="contain: content; flex: 0 0 auto; position: relative; visibility: hidden; width: 4000px; height: 100%; min-width: 4000; pointer-events: auto;"
>
<div
style="margin: 0px; padding: 0px; position: absolute; height: 100%; top: 0px; left: 0px; visibility: hidden; display: flex;"
Expand Down Expand Up @@ -143,7 +143,7 @@ exports[`horizontal should render 1000 children 1`] = `
style="display: inline-block; overflow-x: auto; contain: strict; width: 100%; height: 100%;"
>
<div
style="contain: content; position: relative; visibility: hidden; width: 40000px; height: 100%; min-width: 40000; pointer-events: auto;"
style="contain: content; flex: 0 0 auto; position: relative; visibility: hidden; width: 40000px; height: 100%; min-width: 40000; pointer-events: auto;"
>
<div
style="margin: 0px; padding: 0px; position: absolute; height: 100%; top: 0px; left: 0px; visibility: hidden; display: flex;"
Expand Down Expand Up @@ -193,7 +193,7 @@ exports[`horizontal should render 10000 children 1`] = `
style="display: inline-block; overflow-x: auto; contain: strict; width: 100%; height: 100%;"
>
<div
style="contain: content; position: relative; visibility: hidden; width: 400000px; height: 100%; min-width: 400000; pointer-events: auto;"
style="contain: content; flex: 0 0 auto; position: relative; visibility: hidden; width: 400000px; height: 100%; min-width: 400000; pointer-events: auto;"
>
<div
style="margin: 0px; padding: 0px; position: absolute; height: 100%; top: 0px; left: 0px; visibility: hidden; display: flex;"
Expand Down Expand Up @@ -243,7 +243,7 @@ exports[`horizontal should render component 1`] = `
style="display: inline-block; overflow-x: auto; contain: strict; width: 100%; height: 100%;"
>
<div
style="contain: content; position: relative; visibility: hidden; width: 120px; height: 100%; min-width: 120; pointer-events: auto;"
style="contain: content; flex: 0 0 auto; position: relative; visibility: hidden; width: 120px; height: 100%; min-width: 120; pointer-events: auto;"
>
<div
style="margin: 0px; padding: 0px; position: absolute; height: 100%; top: 0px; left: 0px; visibility: hidden; display: flex;"
Expand Down Expand Up @@ -279,7 +279,7 @@ exports[`horizontal should render with given width / height 1`] = `
style="display: inline-block; overflow-x: auto; contain: strict; width: 100px; height: 800px;"
>
<div
style="contain: content; position: relative; visibility: hidden; width: 200px; height: 100%; min-width: 200; pointer-events: auto;"
style="contain: content; flex: 0 0 auto; position: relative; visibility: hidden; width: 200px; height: 100%; min-width: 200; pointer-events: auto;"
>
<div
style="margin: 0px; padding: 0px; position: absolute; height: 100%; top: 0px; left: 0px; visibility: hidden; display: flex;"
Expand Down Expand Up @@ -334,7 +334,7 @@ exports[`should pass attributes to element 1`] = `
tab-index="0"
>
<div
style="contain: content; position: relative; visibility: hidden; width: 100%; height: 40px; min-height: 40; pointer-events: auto;"
style="contain: content; flex: 0 0 auto; position: relative; visibility: hidden; width: 100%; height: 40px; min-height: 40; pointer-events: auto;"
>
<div
style="margin: 0px; padding: 0px; position: absolute; width: 100%; left: 0px; top: 0px; visibility: hidden;"
Expand All @@ -356,7 +356,7 @@ exports[`vertical should render 0 children 1`] = `
style="display: block; overflow-y: auto; contain: strict; width: 100%; height: 100%;"
>
<div
style="contain: content; position: relative; visibility: hidden; width: 100%; height: 0px; min-height: 0; pointer-events: auto;"
style="contain: content; flex: 0 0 auto; position: relative; visibility: hidden; width: 100%; height: 0px; min-height: 0; pointer-events: auto;"
/>
</div>
</div>
Expand All @@ -370,7 +370,7 @@ exports[`vertical should render 1 children 1`] = `
style="display: block; overflow-y: auto; contain: strict; width: 100%; height: 100%;"
>
<div
style="contain: content; position: relative; visibility: hidden; width: 100%; height: 40px; min-height: 40; pointer-events: auto;"
style="contain: content; flex: 0 0 auto; position: relative; visibility: hidden; width: 100%; height: 40px; min-height: 40; pointer-events: auto;"
>
<div
style="margin: 0px; padding: 0px; position: absolute; width: 100%; left: 0px; top: 0px; visibility: hidden;"
Expand All @@ -392,7 +392,7 @@ exports[`vertical should render 5 children 1`] = `
style="display: block; overflow-y: auto; contain: strict; width: 100%; height: 100%;"
>
<div
style="contain: content; position: relative; visibility: hidden; width: 100%; height: 200px; min-height: 200; pointer-events: auto;"
style="contain: content; flex: 0 0 auto; position: relative; visibility: hidden; width: 100%; height: 200px; min-height: 200; pointer-events: auto;"
>
<div
style="margin: 0px; padding: 0px; position: absolute; width: 100%; left: 0px; top: 0px; visibility: hidden;"
Expand Down Expand Up @@ -442,7 +442,7 @@ exports[`vertical should render 100 children 1`] = `
style="display: block; overflow-y: auto; contain: strict; width: 100%; height: 100%;"
>
<div
style="contain: content; position: relative; visibility: hidden; width: 100%; height: 4000px; min-height: 4000; pointer-events: auto;"
style="contain: content; flex: 0 0 auto; position: relative; visibility: hidden; width: 100%; height: 4000px; min-height: 4000; pointer-events: auto;"
>
<div
style="margin: 0px; padding: 0px; position: absolute; width: 100%; left: 0px; top: 0px; visibility: hidden;"
Expand Down Expand Up @@ -492,7 +492,7 @@ exports[`vertical should render 1000 children 1`] = `
style="display: block; overflow-y: auto; contain: strict; width: 100%; height: 100%;"
>
<div
style="contain: content; position: relative; visibility: hidden; width: 100%; height: 40000px; min-height: 40000; pointer-events: auto;"
style="contain: content; flex: 0 0 auto; position: relative; visibility: hidden; width: 100%; height: 40000px; min-height: 40000; pointer-events: auto;"
>
<div
style="margin: 0px; padding: 0px; position: absolute; width: 100%; left: 0px; top: 0px; visibility: hidden;"
Expand Down Expand Up @@ -542,7 +542,7 @@ exports[`vertical should render 10000 children 1`] = `
style="display: block; overflow-y: auto; contain: strict; width: 100%; height: 100%;"
>
<div
style="contain: content; position: relative; visibility: hidden; width: 100%; height: 400000px; min-height: 400000; pointer-events: auto;"
style="contain: content; flex: 0 0 auto; position: relative; visibility: hidden; width: 100%; height: 400000px; min-height: 400000; pointer-events: auto;"
>
<div
style="margin: 0px; padding: 0px; position: absolute; width: 100%; left: 0px; top: 0px; visibility: hidden;"
Expand Down Expand Up @@ -592,7 +592,7 @@ exports[`vertical should render component 1`] = `
style="display: block; overflow-y: auto; contain: strict; width: 100%; height: 100%;"
>
<div
style="contain: content; position: relative; visibility: hidden; width: 100%; height: 120px; min-height: 120; pointer-events: auto;"
style="contain: content; flex: 0 0 auto; position: relative; visibility: hidden; width: 100%; height: 120px; min-height: 120; pointer-events: auto;"
>
<div
style="margin: 0px; padding: 0px; position: absolute; width: 100%; left: 0px; top: 0px; visibility: hidden;"
Expand Down Expand Up @@ -628,7 +628,7 @@ exports[`vertical should render with given width / height 1`] = `
style="display: block; overflow-y: auto; contain: strict; width: 100px; height: 800px;"
>
<div
style="contain: content; position: relative; visibility: hidden; width: 100%; height: 200px; min-height: 200; pointer-events: auto;"
style="contain: content; flex: 0 0 auto; position: relative; visibility: hidden; width: 100%; height: 200px; min-height: 200; pointer-events: auto;"
>
<div
style="margin: 0px; padding: 0px; position: absolute; width: 100%; left: 0px; top: 0px; visibility: hidden;"
Expand Down

0 comments on commit 5b7d354

Please sign in to comment.