RolePicker: Add extra offset for menu position (#49823) (#49831)

(cherry picked from commit a71e371877)

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2022-05-30 16:21:04 +02:00
committed by GitHub
co-authored by Alex Khomenko
parent fd8c11f51d
commit 9a33b19662
@@ -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);