bug: when navigating from another page, page opens late
Closed this issue · 3 comments
Affected Packages
- @yeger/eslint-config
- @yeger/vue-masonry-wall
- @yeger/vue2-masonry-wall
- vecti
Description
When I visit the page from another page it navigates to that page late. It happens whenever I navigate to the page from another page. I changed MasonryWall with a standard div element, and it worked perfectly. As a default, I fetch 20 items, and when I change it to 3-4 items, it works well again. Here is the code for the page:
`
<script setup> import { breakpointsTailwind, useBreakpoints } from '@vueuse/core' const breakpoints = useBreakpoints(breakpointsTailwind) const wallGap = ref(null) const imageStore = useImageStore() const { images, loading } = storeToRefs(imageStore) function generateRandomHeights(numPlaceholders, minHeight, maxHeight) { const heights = []; for (let i = 0; i < numPlaceholders; i++) { const randomHeight = Math.floor(Math.random() * (maxHeight - minHeight + 1) + minHeight); heights.push(`${randomHeight}px`); } return heights; } onMounted(async () => { wallGap.value = breakpoints.isGreaterOrEqual('md') ? 12 : 4 await imageStore.fetchImages() }) </script>`
Reproduction
The problem does not happen on the laptop. When I start the dev server using 'npm run dev -- --host', and then open the app on my mobile phone, I see the problem. It happens in production on mobile phones as well.
Additional context
No response
Preferences
- I want to be assigned to and work on this issue myself
This is not an issue of this component.
Hello.
When I replace MasonryWall with a div element, it works as expected.
Did you manage to reproduce the problem that I faced?
Do you have any suggestions?
I won't reproduce your issue, please see https://antfu.me/posts/why-reproductions-are-required and consider creating a minimal reproduction.