react-laag icon indicating copy to clipboard operation
react-laag copied to clipboard

Make repositioning less glitchy

Open rijk opened this issue 3 years ago • 1 comments

Here's a screen capture of what I mean:

https://user-images.githubusercontent.com/159500/105332099-86eff800-5bd4-11eb-963b-618ae73cced5.mov

There's a 1 frame glitch where the tooltip grows and is then repositioned:

image

This looks bad. Ideas for improvement:

  • Maybe it's possible to do a calculation before render, like Framer Motion?
  • Be smarter how to position the layer. In this case, use bottom instead of top.
  • Add an option to disable repositioning after initial positioning (related to #55)

rijk avatar Jan 21 '21 09:01 rijk

Be smarter how to position the layer. In this case, use bottom instead of top.

Popper JS does this BTW: https://popper.js.org/docs/v2/modifiers/compute-styles/#adaptive

Add an option to disable repositioning after initial positioning

I also enjoy the way Popper gives you more control over this (with an update() function you can call when you see fit). But it might not fit your vision for this library.

rijk avatar Feb 04 '21 13:02 rijk