Skip to content

Commit

Permalink
[Dashboard] [Usability] Add scroll margin to panels (#193430)
Browse files Browse the repository at this point in the history
## Summary

Closes [[Bug] Upper part of the chart is hidden when user edits a chart
inline · Issue #192437 · elastic/kibana ·
GitHub](#192437)

This PR disables the overflow-y hidden css and the panel is set to the
top. Users are also able to scroll to the top of the visualization in
inline editing mode.

### Now: 


https://github.com/user-attachments/assets/a68a3bdc-5452-40f3-84a6-4950e2fc7893

---------

Co-authored-by: Hannah Mudge <[email protected]>
  • Loading branch information
rshen91 and Heenawter authored Oct 7, 2024
1 parent ecc7d4e commit b4d52e4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
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

0 comments on commit b4d52e4

Please sign in to comment.