everweij / react-laag

Hooks to build things like tooltips, dropdown menu's and popovers in React

Home Page:https://www.react-laag.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make repositioning less glitchy

rijk opened this issue · comments

Here's a screen capture of what I mean:

Screen.Recording.2021-01-21.at.10.34.06.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)

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.