Comments (4)
from core.
Hello!
It seems to be the expected behavior of your codes, this part of the code
.list-leave-active { position: absolute; }
Causes the element to be positioned absolutely during transition, which means the element won't follow the usual flow of the document anymore. In this case, because u didn't specify its ancestor, it will have different behavior when it is scrolled vs when it isn't as it will be absolutely positioned against the viewport, you see this by manually adding absolute position to each test element. Here is ChatGpt explanation of it.
You can fix this either by
- Removing absolute positioning (.list-leave-active) in the transition. However this will cause the top and bottom element to snap at the end of transition instead of smoothly moving to position.
- By adding
position: relative
to .list-box1 class, however, it is still not a perfect solution as it will cause the .test element to move downward a little bit due to the fact that the scrolling container resizes. This container resizing is why upper element is not affected but bottom element is affected by this. If you don't like this, the only way left is to change the transition animation.
Hope this helps!
from core.
Hello!
It seems to be the expected behavior of your codes, this part of the code
.list-leave-active { position: absolute; }
Causes the element to be positioned absolutely during transition, which means the element won't follow the usual flow of the document anymore. In this case, because u didn't specify its ancestor, it will have different behavior when it is scrolled vs when it isn't as it will be absolutely positioned against the viewport, you see this by manually adding absolute position to each test element. Here is ChatGpt explanation of it.
You can fix this either by
- Removing absolute positioning (.list-leave-active) in the transition. However this will cause the top and bottom element to snap at the end of transition instead of smoothly moving to position.
- By adding
position: relative
to .list-box1 class, however, it is still not a perfect solution as it will cause the .test element to move downward a little bit due to the fact that the scrolling container resizes. This container resizing is why upper element is not affected but bottom element is affected by this. If you don't like this, the only way left is to change the transition animation.Hope this helps!
Thank you!
I really hope there is a perfect solution, but it seems impossible to achieve it at the moment, so I can only give up.
from core.
You need to make your items position relative to the container, i.e. add position: relative
to .list-box1
: demo
from core.
Related Issues (20)
- template ref with reactive in v-for always empty in production mode HOT 3
- Can’t use Typescript Utilities Pick and Omit HOT 1
- JSDoc missing when using emits shorthand HOT 1
- Suspense #fallback not work in defineOptions preFetch in ssr mode HOT 2
- animation when leave in transitiongroup with ref tag not work HOT 3
- 🦑你的官网我这边无法触发点击事件。 HOT 1
- defineProps 默认对 boolean 类型的 prop 自动转换为 false 不符合语义 HOT 6
- Vue diff component component execution mounted order problem HOT 3
- `defineModel` coerces string to boolean in production build when `string | boolean` union is used HOT 3
- <transition appear> is breaking/flickering when toggling hide/show while transition is happening HOT 3
- Bug function createHydrationFunctions(rendererInternals) HOT 11
- `reactive` and `shallowRef` affect each other when they include the same object together HOT 1
- <script setup lang="tsx"> 在热更新时抛出错误 HOT 4
- Cannot add an element to array HOT 3
- Vue2 -> Vue3 Prop vs. Computed Regression? HOT 2
- Slots in loops only assigned once when component used as custom element HOT 3
- Compiler parse does not generate correct `loc` if end tag has whitepaces after the name
- Refs inside v-for doesn't apply through v-bind HOT 4
- Emit is not listening only from parent component HOT 1
- defineModel not support calling methods expression HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.