nkbt / react-collapse

Component-wrapper for collapse animation with react-motion for elements with variable (and dynamic) height
MIT License
1.12k stars 113 forks source link

React-collapse does not work on some zoom levels (devicePixelRatio =1.25) Following up #238 #272

Closed mlp73 closed 4 years ago

mlp73 commented 4 years ago

As i cannot reopen the previous issue #238 I create a new one following it up.

Using react collapse 5.0.0 I can confirm that the issue persists.

overflow: hidden is set while the animation is going on, and set back to auto at the end. It calculates what will be the final height but because of it counting based on half-pixels because of devicePixelRatio it seems that it never finishes. Så overflow:hidden is then never removed.

I can reproduce everywhere react-collapse is used by using devicePixelRatio = 1.25. On my very screen it is with a 110% zoom. For some of our testers it is whit 75% zoom, so it depend on your resolution. (When you zoom +/-, the devicePixelRatio changes, and it happens always with devicePixelRatio = 1.25) To know which devicePixelRatio you have on your window, you can write window.devicePixelRatio in the console.

@nkbt Is it something you could try to reproduce?

nkbt commented 4 years ago

238 is reopened