Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] [Dashboard] [Usability] Add scroll margin to panels (#193430) #195323

Merged
merged 2 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/plugins/dashboard/public/dashboard_api/track_panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ export function initializeTrackPanel(untilEmbeddableLoaded: (id: string) => Prom
};
return;
}

panelRef.scrollIntoView({ block: 'center' });
panelRef.scrollIntoView({ block: 'nearest' });
});
},
scrollToTop: () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const Item = React.forwardRef<HTMLDivElement, Props>(
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,
Expand Down