fix(popover): clamp y position when on bottom

This commit is contained in:
Jeremy Soller 2024-10-07 10:32:33 -06:00
parent 173a9557c2
commit 93578816f9
No known key found for this signature in database
GPG key ID: D02FD439211AF56F

View file

@ -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