nimiq / crypto-map

The Crypto Map by Nimiq. Explore the world and find places to spend your crypto.
https://map.nimiq.com
6 stars 3 forks source link

Matheo/wip #4

Closed onmax closed 1 year ago

onmax commented 1 year ago

@mraveux I forgot to mention that there is another case, that seems to be broken now:

Clicking on a marker to open the card will result in a weird opening behaviour. See this GIF https://gyazo.com/ad1162eec50b2e7b0aa4dd01a34088a5

That's what the code from @sisou was doing

netlify[bot] commented 1 year ago

Deploy Preview for nimiq-map ready!

Name Link
Latest commit 575db1113e3945e86efb8d6e259e42fe7270797a
Latest deploy log https://app.netlify.com/sites/nimiq-map/deploys/65292e6b79f988000801e1f3
Deploy Preview https://deploy-preview-4--nimiq-map.netlify.app/
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

mraveux commented 1 year ago

@onmax yes if this is caused by the scrollIntoView then we can just go back to the scrollTo and getBoundingClientRect.

Albermonte commented 1 year ago

If you click on a location in the map, then start dragging and release after progress is >50% but not 100%, the same error happens again

https://gyazo.com/d719327cc433c0a9358c466d34e57307

onmax commented 1 year ago

Please also check this project:

mraveux commented 1 year ago

I think I found the origin of the issue. Apparently setting the dynamic padding on the parent element (li) of the SheetModal (article) was conflicting with safari snap’s position calculation. Since the padding on the li and the width of the article were changing at the same time as the snap was trying to center the element, it was creating this issue where everything would end up translated on the side / out of screen. Setting the padding now on the article directly, and not changing the card width, seems to fix the issue.

sisou commented 1 year ago

@mraveux By setting the width to 100vw, are the cards still able to shrink and show the previous and next partially at the screen edge when not expanded?

mraveux commented 1 year ago

Yes @sisou, it should look exactly the same as before.