question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BasicTransition applying position: fixed to one of the animated elements

See original GitHub issue

Bug description I have noticed this when using the TabsTransition with a layout that contains a div with overflow: hidden, to make the website content the size of a mobile phone screen. The TabsTransition uses the Svelte’s fly transition, which displaces the element. The incoming element got cut off properly by the overflow: hidden, but the element that was disappearing wasn’t cut off. I have looked in the dev tools to see what happens during the animation and noticed that the element that is disappearing got a position: fixed property applied. This causes my problem. The overflow: hidden property is ignored and the element doesn’t get cut off correctly.

To better see what we are aiming for and what happens, here is a screenshot of the application. The incoming element at the right gets cut off properly while the other one stays in the screen in it’s whole beauty.

image

Here is the part of the _layout.svelte file responsible for these routes. (We are using Tailwind)

<div class="overflow-hidden">
    <slot decorator={TabTransition} />
</div>

As one of the elements is cut off properly, I believe that the other one can be fixed too.

Version

"@roxi/routify": "^2.12.4",

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

0reactions
jakobrosenbergcommented, Mar 18, 2021

Great. Closing this for now. 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

Transition for moving objects with position: fixed?
Using a transition or animation with transform get GPU acceleration, where transitioning top does not. $('button').on('click', function() ...
Read more >
Using CSS transitions - CSS: Cascading Style Sheets | MDN
CSS transitions provide a way to control animation speed when changing CSS properties. Instead of having property changes take effect ...
Read more >
An Interactive Guide to CSS Transitions - Josh W Comeau
This comprehensive guide shows how to use CSS transitions! A back-to-basics look at the fundamental building blocks we need to create ...
Read more >
Perfectly smooth transition between fixed and variable ...
Perfectly smooth transition between fixed and variable positioning of HTML elements using CSS and Javascript. A little excursion into CSS ...
Read more >
Using Multi-Step Animations and Transitions - CSS-Tricks
CSS animations are rad and the concept is fairly simple. Name the animation, define the movement in @keyframes and then call that animation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found