HomePhabricator

Introduce FloatableElement mixin

Authored by matmarex.

Description

Introduce FloatableElement mixin

Extracted from FloatingMenuSelectWidget. For use in DateInputWidget
and CalendarWidget (see linked bug), and maybe PopupWidget could use
it too?

This code requires a zen-like concentration from the maintainer to
read, much less modify. I'm not sure if it's because it sucks or
because the problem we're solving is just difficult. I am, however,
pretty sure I failed to achieve it and gotten plenty of things wrong,
but I dare not poke it further, as long the $overlay dialog demo works.

Between this and ClippableElement, I honestly couldn't convincingly
explain how they interact and why this even works. I think we're
measuring, positioning and clipping too many things too many times,
or maybe not enough times and it breaks in some corner cases.

Bug: T112676
Change-Id: I658012b7b4fe398c29dd361912d9fee68d95db21