Improve layout shift on load
FlxMgdnz opened this issue · comments
Felix Magedanz commented
Pages that integrate Hanko currently suffer from a layout shift or "flicker effect" when the Hanko Element loads:
20231018-0941-30.8917334.mp4
This should be improved. Ideas:
- Give the component reasonable values for min-height and min-width
- Implement transitions, i.e. if the content of the component changes, do a transition from height a to height b (to avoid the flicker effect) - this should also work on initial load, but also all other layout changes when going through the flows will benefit
Dev Johri commented
If this issue is available. can i try it?
Felix Magedanz commented
It's here somewhere: https://github.com/teamhanko/hanko/tree/main/frontend/elements/src
I think part of the task is figuring out the right hierarchical level where to apply the changes to.