Skip to content

Commit

Permalink
[Inventory] Fix top empty space in side navigation when content excee…
Browse files Browse the repository at this point in the history
…ds window height (elastic#195756)

## Summary

Fixes  elastic#195203


This PR addresses an issue in the new Inventory plugin where the side
navigation displayed an unexpected empty space at the top whenever the
page content exceeded the window height.


|Before|After|
|-|-|

|![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)|
  • Loading branch information
iblancof authored Oct 11, 2024
1 parent e18c52e commit 095113f
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 095113f

Please sign in to comment.