rio-labs/rio

`rio.Switcher` transition_time of 0.0 breaks layout

Closed this issue · 1 comments

Describe the bug

When setting the transition_time of rio.Switcher to 0.0, it causes the layout to break. This issue manifests as incorrect positioning or unexpected behavior in the layout of the components managed by rio.Switcher.

Expected Behavior

Setting the transition_time to 0.0 should result in an instantaneous switch between components without affecting the layout. The layout should remain consistent and correct, just as it would with a non-zero transition time.

Steps to Reproduce

  1. Initialize rio.Switcher with a component or None.
  2. Set the transition_time=0.0 of rio.Switcher.
  3. Trigger a switch between the components.
  4. Observe the layout behavior and note any issues.

Screenshots/Videos

Rio.-.Switcher.-.Profil.1.Microsoft.Edge.2024-06-07.09-22-36.mp4

Operating System

Windows

What browsers are you seeing the problem on?

Chrome, Safari, Edge

Browser version

No response

What device are you using?

Desktop

Additional context

No response

A quickfix with ~max(transition_time, 0.01) was added, but it doesn't solve the issue 😄