compose-multiplatform
compose-multiplatform copied to clipboard
Add ability to set the size of popup, which depends on the window bounds
We can add a new parameter:
Popup(
popupSizeProvider: PopupSizeProvider
)
interface PopupSizeProvider {
fun calculatePosition(
anchorBounds: IntRect,
windowSize: IntSize,
layoutDirection: LayoutDirection,
popupContentSize: IntSize
): IntSize
}
or maybe better PopupBoundsProvider:
interface PopupBoundsProvider {
fun calculatePosition(
anchorBounds: IntRect,
windowSize: IntSize,
layoutDirection: LayoutDirection,
popupContentSize: IntSize
): IntRect
}
It will allow to place popup whenever we want. For example, we would can place dropdown menu above the component, if it can't be placed below the component.
Also, before we do that, it probably would be helpful, if we cover in docs, that constraints passed to Popup are equals the window size by default.
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.