LavaUI docs

enum OverlayAlignment

Swift

enum OverlayAlignment

Content drawn above everything, anchored to the view that presents it.

Menus, dropdowns and tooltips all need the same three things, and none of them fit the normal tree walk:

  • Paint above everything. Paint order is emission order, so a popup emitted where its presenter sits would be covered by every later sibling. Overlays are collected during the walk and emitted after it.
  • Escape the clip. A dropdown inside a ScrollView must not be scissored to it. Emitting after the walk gets this for free: the clip stack is back to empty by then.
  • Take input first. A click on a menu must not fall through to whatever is underneath, and a click outside must dismiss it rather than activate what it hit.

Sources/LavaUI/Overlay.swift:18

Cases

case below

Below the presenter, flipping above when there is no room.

Sources/LavaUI/Overlay.swift:20

case above

Above the presenter, flipping below when there is no room.

Sources/LavaUI/Overlay.swift:22