vaheqelyan / svelte-grid

A responsive, draggable and resizable grid layout, for Svelte. [NOT MAINTAINED]
https://svelte-grid.now.sh/
MIT License
970 stars 58 forks source link

Can't scroll on mobile device if touched on grid item. #155

Open sumbganesh opened 8 months ago

sumbganesh commented 8 months ago

I have grid layout in my page. But in mobile devices, when i try to scroll by touching on any item in the grid, it won't scroll, but it will scroll when I touch on in gap or outside the items. How can I fix it?

oleksii-dukhovenko commented 8 months ago
const touchScrollAllow = async () => {
    await tick()
    for(let elm of document.querySelectorAll('.svlt-grid-item'))
        elm.style.touchAction = 'auto'
}

afterUpdate(()=>{
    touchScrollAllow()
})