diff --git a/packages/kbn-unified-data-table/src/components/data_table.scss b/packages/kbn-unified-data-table/src/components/data_table.scss index 3ad348973ee81..25bce5cdf88c5 100644 --- a/packages/kbn-unified-data-table/src/components/data_table.scss +++ b/packages/kbn-unified-data-table/src/components/data_table.scss @@ -161,3 +161,12 @@ display: none; } } + +// Ensure full screen data grids are not covered by elements with a z-index +.euiDataGrid__restrictBody *:not( +.euiDataGrid--fullScreen, +.euiDataGrid--fullScreen *, +[data-euiportal='true'], +[data-euiportal='true'] *) { + z-index: unset !important; +} \ No newline at end of file diff --git a/test/functional/apps/discover/group2/_data_grid.ts b/test/functional/apps/discover/group2/_data_grid.ts index d869044613873..2facbc95c93ce 100644 --- a/test/functional/apps/discover/group2/_data_grid.ts +++ b/test/functional/apps/discover/group2/_data_grid.ts @@ -17,6 +17,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const defaultSettings = { defaultIndex: 'logstash-*' }; const testSubjects = getService('testSubjects'); const security = getService('security'); + const retry = getService('retry'); + const browser = getService('browser'); before(async function () { await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader']); @@ -47,6 +49,43 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(await getTitles()).to.be('@timestamp Document'); }); + const isVisible = async (selector: string) => { + const element = await testSubjects.find(selector); + const { x, y, width, height } = await element.getPosition(); + return browser.execute( + (innerSelector, innerX, innerY) => { + let currentElement = document.elementFromPoint(innerX, innerY); + while (currentElement) { + if (currentElement.matches(`[data-test-subj="${innerSelector}"]`)) { + return true; + } + currentElement = currentElement.parentElement; + } + return false; + }, + selector, + x + width / 2, + y + height / 2 + ); + }; + + it('should hide elements beneath the table when in full screen mode regardless of their z-index', async () => { + await retry.try(async () => { + expect(await isVisible('unifiedHistogramQueryHits')).to.be(true); + expect(await isVisible('unifiedHistogramResizableButton')).to.be(true); + }); + await testSubjects.click('dataGridFullScreenButton'); + await retry.try(async () => { + expect(await isVisible('unifiedHistogramQueryHits')).to.be(false); + expect(await isVisible('unifiedHistogramResizableButton')).to.be(false); + }); + await testSubjects.click('dataGridFullScreenButton'); + await retry.try(async () => { + expect(await isVisible('unifiedHistogramQueryHits')).to.be(true); + expect(await isVisible('unifiedHistogramResizableButton')).to.be(true); + }); + }); + it('should show the the grid toolbar', async () => { await testSubjects.existOrFail('dscGridToolbar'); });