Skip to content

Commit

Permalink
[8.x] [Inventory] Fix top empty space in side navigation when content…
Browse files Browse the repository at this point in the history
… exceeds window height (#195756) (#195878)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Inventory] Fix top empty space in side navigation when content
exceeds window height
(#195756)](#195756)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Irene
Blanco","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-11T09:57:10Z","message":"[Inventory]
Fix top empty space in side navigation when content exceeds window
height (#195756)\n\n## Summary\r\n\r\nFixes
https://github.com/elastic/kibana/issues/195203\r\n\r\n\r\nThis PR
addresses an issue in the new Inventory plugin where the
side\r\nnavigation displayed an unexpected empty space at the top
whenever the\r\npage content exceeded the window
height.\r\n\r\n\r\n|Before|After|\r\n|-|-|\r\n\r\n|![scroll_fix_before](https://github.com/user-attachments/assets/3eaa4aa5-d42c-4424-9bd4-4225c469c957)|![scroll_fix_after](https://github.com/user-attachments/assets/7a936c05-6c74-463d-b5d6-11e26ff9d191)|","sha":"095113faa51d16ea750eaef9c3b11cfe4c0db3a4","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-infra_services","v8.16.0"],"title":"[Inventory]
Fix top empty space in side navigation when content exceeds window
height","number":195756,"url":"https://github.com/elastic/kibana/pull/195756","mergeCommit":{"message":"[Inventory]
Fix top empty space in side navigation when content exceeds window
height (#195756)\n\n## Summary\r\n\r\nFixes
https://github.com/elastic/kibana/issues/195203\r\n\r\n\r\nThis PR
addresses an issue in the new Inventory plugin where the
side\r\nnavigation displayed an unexpected empty space at the top
whenever the\r\npage content exceeded the window
height.\r\n\r\n\r\n|Before|After|\r\n|-|-|\r\n\r\n|![scroll_fix_before](https://github.com/user-attachments/assets/3eaa4aa5-d42c-4424-9bd4-4225c469c957)|![scroll_fix_after](https://github.com/user-attachments/assets/7a936c05-6c74-463d-b5d6-11e26ff9d191)|","sha":"095113faa51d16ea750eaef9c3b11cfe4c0db3a4"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195756","number":195756,"mergeCommit":{"message":"[Inventory]
Fix top empty space in side navigation when content exceeds window
height (#195756)\n\n## Summary\r\n\r\nFixes
https://github.com/elastic/kibana/issues/195203\r\n\r\n\r\nThis PR
addresses an issue in the new Inventory plugin where the
side\r\nnavigation displayed an unexpected empty space at the top
whenever the\r\npage content exceeded the window
height.\r\n\r\n\r\n|Before|After|\r\n|-|-|\r\n\r\n|![scroll_fix_before](https://github.com/user-attachments/assets/3eaa4aa5-d42c-4424-9bd4-4225c469c957)|![scroll_fix_after](https://github.com/user-attachments/assets/7a936c05-6c74-463d-b5d6-11e26ff9d191)|","sha":"095113faa51d16ea750eaef9c3b11cfe4c0db3a4"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Irene Blanco <[email protected]>
  • Loading branch information
kibanamachine and iblancof authored Oct 11, 2024
1 parent c4ec89d commit a402448
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
*/
import React from 'react';
import ReactDOM from 'react-dom';
import { APP_WRAPPER_CLASS, type AppMountParameters, type CoreStart } from '@kbn/core/public';
import { type AppMountParameters, type CoreStart } from '@kbn/core/public';
import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render';
import { css } from '@emotion/css';
import type { InventoryStartDependencies } from './types';
import { InventoryServices } from './services/types';
import { AppRoot } from './components/app_root';
Expand All @@ -25,12 +24,6 @@ export const renderApp = ({
} & { appMountParameters: AppMountParameters }) => {
const { element } = appMountParameters;

const appWrapperClassName = css`
overflow: auto;
`;
const appWrapperElement = document.getElementsByClassName(APP_WRAPPER_CLASS)[1];
appWrapperElement.classList.add(appWrapperClassName);

ReactDOM.render(
<KibanaRenderContextProvider {...coreStart}>
<AppRoot
Expand All @@ -44,6 +37,5 @@ export const renderApp = ({
);
return () => {
ReactDOM.unmountComponentAtNode(element);
appWrapperElement.classList.remove(APP_WRAPPER_CLASS);
};
};

0 comments on commit a402448

Please sign in to comment.