mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Fix position for RolePickerMenu being out of bounds (#85604)
* Fix position for RolePickerMenu being out of bounds * adjust the offset of the role picker menu
This commit is contained in:
parent
483dc02b68
commit
85e66d8edb
@ -84,10 +84,11 @@ export const RolePicker = ({
|
||||
let menuToLeft = false;
|
||||
|
||||
const distance = window.innerHeight - bottom;
|
||||
vertical = bottom;
|
||||
if (distance < MENU_MAX_HEIGHT + 20) {
|
||||
// Off set to display the role picker menu at the bottom of the screen
|
||||
// without resorting to scroll the page
|
||||
vertical = top - MENU_MAX_HEIGHT - 50;
|
||||
// Limit the top position to 80px to avoid the menu going off the screen
|
||||
vertical = top < 80 ? 80 : top;
|
||||
horizontal += right - left + 8;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -89,7 +89,7 @@ export const getStyles = (theme: GrafanaTheme2) => ({
|
||||
}),
|
||||
menuOptionExpand: css({
|
||||
position: 'absolute',
|
||||
right: theme.spacing(1.25),
|
||||
right: theme.spacing(2.5),
|
||||
color: theme.colors.text.disabled,
|
||||
|
||||
'&:after': {
|
||||
|
Loading…
Reference in New Issue
Block a user