From bc67edbff8db6a47f7fea22401599ae0c3bf7dc0 Mon Sep 17 00:00:00 2001 From: linoman <2051016+linoman@users.noreply.github.com> Date: Wed, 8 Feb 2023 12:09:27 +0100 Subject: [PATCH] Fix RolePicker component offset when it has too many roles (#62857) Fix role picker offset with too many roles --- public/app/core/components/RolePicker/RolePicker.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/app/core/components/RolePicker/RolePicker.tsx b/public/app/core/components/RolePicker/RolePicker.tsx index 9c9406ef6fc..f640b9965b1 100644 --- a/public/app/core/components/RolePicker/RolePicker.tsx +++ b/public/app/core/components/RolePicker/RolePicker.tsx @@ -64,7 +64,9 @@ export const RolePicker = ({ let vertical = -offsetVertical; if (distance < MENU_MAX_HEIGHT + 20) { - vertical = offsetVertical; + // Off set to display the role picker menu at the bottom of the screen + // without resorting to scroll the page + vertical = 50 + (MENU_MAX_HEIGHT - distance) - offsetVertical; } /*