Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.11] [Unified Data Table] Fix elements with defined z-index overlapping grid in full screen mode (#168545) #169949

Merged
merged 2 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
39 changes: 39 additions & 0 deletions test/functional/apps/discover/group2/_data_grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down Expand Up @@ -46,5 +48,42 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.unifiedFieldList.clickFieldListItemRemove('agent');
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);
});
});
});
}
Loading