From 93578816f9a3ac6aeb24d6f3223d43e3f228d106 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 7 Oct 2024 10:32:33 -0600 Subject: [PATCH] fix(popover): clamp y position when on bottom --- src/widget/popover.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/widget/popover.rs b/src/widget/popover.rs index e11fb95e..cb15da91 100644 --- a/src/widget/popover.rs +++ b/src/widget/popover.rs @@ -317,7 +317,9 @@ where Position::Bottom => { // Position is set to the center bottom of the widget let width = node.size().width; + let height = node.size().height; position.x = (position.x - width / 2.0).clamp(0.0, bounds.width - width); + position.y = position.y.clamp(0.0, bounds.height - height); } Position::Point(_) => { // Position is using context menu logic