transitionDuration in v4 not working
See original GitHub issueI’ve migrated from v3 to v4 on my Svelte app and now, for some reason, transitionDuration
stopped working i.e. doesn’t animate my grid anymore when I change screensize. Here’s my code on v4
<script>
import { onMount } from 'svelte'
import { MasonryInfiniteGrid } from '@egjs/svelte-infinitegrid'
import Spinner from '../../components/ui/Spinner.svelte'
import { stores } from '@sapper/app'
import { toHSL, sleep } from 'utils'
import tinycolor from 'tinycolor2'
const { session } = stores()
let mountedToDom = false
let ig
let loading
let items = []
const loadItems = (groupKey, nextKey, itemCount) => {
const nextItems = []
for (let i = 0; i < itemCount; ++i) {
nextItems.push({ groupKey, key: nextKey + i })
}
return nextItems
}
const onAppend = async ({ detail: { groupKey, startLoading } }) => {
// if (ig.isProcessing()) {
// return
// }
// startLoading()
// await sleep(3000)
const nextGroupKey = (parseFloat(groupKey) || 0) + 1
const nextKey = items.length
items = [...items, ...loadItems(nextGroupKey, nextKey, 10)]
}
const onLayoutComplete = ({ detail: { isLayout, endLoading } }) => { !isLayout && endLoading() }
onMount(() => { mountedToDom = true })
</script>
{#if mountedToDom }
<div class="my-6 md:my-10">
<MasonryInfiniteGrid
gap={10}
align={"center"}
isConstantSize={true}
transitionDuration={0.7}
{items}
{loading}
bind:this={ig}
let:visibleItems
groupBy={item => item.groupKey}
itemBy={item => item.key}
on:requestAppend={onAppend}
>
{#each visibleItems as item, index (item.key)}
<div class="thumbnail">
<img src={`https://naver.github.io/egjs-infinitegrid/assets/image/${(item.key % 59) + 1}.jpg`} alt="edm"/>
</div>
{/each}
</MasonryInfiniteGrid>
</div>
{/if}
<style>
.item {
width: 300px;
opacity: 1;
border-radius: 0.3rem;
overflow: hidden;
border-width: 4px;
}
.item .thumbnail {
max-height: 300px;
overflow: hidden;
}
.item .thumbnail img {
width: 100%;
/* border-radius: 0.2rem; */
}
</style>
Any ideas why it stopped working? Also, in v3 I used options={{ isConstantSize: true, transitionDuration: 0.7 }}
but figured that stopped working in v4 so I switched to using options such isConstantSize
etc. as shown in the code above. Is that correct in v4?
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Transition duration not working on bootstrap button
I am trying to add transition effect on some bootstrap buttons. The problem is with height and width properties.
Read more >transition-duration - CSS: Cascading Style Sheets | MDN
The transition-duration CSS property sets the length of time a transition animation should take to complete. By default, the value is 0s, ...
Read more >Transition-duration NOT working??? (Example) - Treehouse
It was working for about 10 minutes, but then just stopped. I rebooted my computer twice, still nothing.is it just on my browser/computer??...
Read more >Why is my transition-duration not working? : r/csshelp - Reddit
Hi, I am new to coding, taking classes on Coursera. I am learning CSS and as I was doing an assignment I wanted...
Read more >Adjust transitions in the Final Cut Pro timeline - Apple Support
In Final Cut Pro, change a transition's duration, move it using a roll edit, or trim the left clip's end point or the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@evdama
infinitegrid’s new version 4.1.0 is released. And support transition.
https://naver.github.io/egjs-infinitegrid/Guides#use-transition
@evdama in v3
but in v4