From 095113faa51d16ea750eaef9c3b11cfe4c0db3a4 Mon Sep 17 00:00:00 2001 From: Irene Blanco Date: Fri, 11 Oct 2024 11:57:10 +0200 Subject: [PATCH] [Inventory] Fix top empty space in side navigation when content exceeds window height (#195756) ## Summary Fixes https://github.com/elastic/kibana/issues/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)| --- .../inventory/public/application.tsx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/x-pack/plugins/observability_solution/inventory/public/application.tsx b/x-pack/plugins/observability_solution/inventory/public/application.tsx index d34be920d68ff..7b611d1d04c22 100644 --- a/x-pack/plugins/observability_solution/inventory/public/application.tsx +++ b/x-pack/plugins/observability_solution/inventory/public/application.tsx @@ -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'; @@ -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( { ReactDOM.unmountComponentAtNode(element); - appWrapperElement.classList.remove(APP_WRAPPER_CLASS); }; };