From 9a33b19662bd5a439f29202b2f90bc4de647d96e Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Mon, 30 May 2022 10:21:04 -0400 Subject: [PATCH] RolePicker: Add extra offset for menu position (#49823) (#49831) (cherry picked from commit a71e371877f2fe113461887409933360e6470d46) Co-authored-by: Alex Khomenko --- public/app/core/components/RolePicker/RolePicker.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/core/components/RolePicker/RolePicker.tsx b/public/app/core/components/RolePicker/RolePicker.tsx index d2fdba81cfc..439ddec4f8e 100644 --- a/public/app/core/components/RolePicker/RolePicker.tsx +++ b/public/app/core/components/RolePicker/RolePicker.tsx @@ -53,7 +53,7 @@ export const RolePicker = ({ const { bottom, top } = dimensions; const distance = window.innerHeight - bottom; const offset = bottom - top + 10; // Add extra 10px to offset to account for border and outline - if (distance < MENU_MAX_HEIGHT) { + if (distance < MENU_MAX_HEIGHT + 20) { setOffset(offset); } else { setOffset(-offset);