diff --git a/src/plugins/dashboard/public/dashboard_container/component/grid/_dashboard_panel.scss b/src/plugins/dashboard/public/dashboard_container/component/grid/_dashboard_panel.scss index 5a252f9bf1630..d54f513a207a4 100644 --- a/src/plugins/dashboard/public/dashboard_container/component/grid/_dashboard_panel.scss +++ b/src/plugins/dashboard/public/dashboard_container/component/grid/_dashboard_panel.scss @@ -4,6 +4,11 @@ * .embPanel--editing doesn't get updating without a hard refresh */ +.dshDashboardGrid__item { + scroll-margin-top: calc((var(--euiFixedHeadersOffset, 100) * 2) + $euiSizeS); + scroll-margin-bottom: $euiSizeS; +} + // LAYOUT MODES // Adjust borders/etc... for non-spaced out and expanded panels .dshLayout-withoutMargins { @@ -36,9 +41,11 @@ 0% { outline: solid $euiSizeXS transparentize($euiColorSuccess, 1); } + 25% { outline: solid $euiSizeXS transparentize($euiColorSuccess, .5); } + 100% { outline: solid $euiSizeXS transparentize($euiColorSuccess, 1); } diff --git a/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid_item.tsx b/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid_item.tsx index d4fd84618747d..28788f38826f5 100644 --- a/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid_item.tsx +++ b/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid_item.tsx @@ -53,7 +53,7 @@ export const Item = React.forwardRef( const hidePanel = expandedPanelId !== undefined && expandedPanelId !== id; const focusPanel = focusedPanelId !== undefined && focusedPanelId === id; const blurPanel = focusedPanelId !== undefined && focusedPanelId !== id; - const classes = classNames({ + const classes = classNames('dshDashboardGrid__item', { 'dshDashboardGrid__item--expanded': expandPanel, 'dshDashboardGrid__item--hidden': hidePanel, 'dshDashboardGrid__item--focused': focusPanel, diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx b/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx index 45f3b2535ff6d..23052bd094e82 100644 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx +++ b/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx @@ -784,7 +784,7 @@ export class DashboardContainer return; } - panelRef.scrollIntoView({ block: 'center' }); + panelRef.scrollIntoView({ block: 'nearest' }); }); };