Skip to content

Commit

Permalink
fix: display tooltips over notifications (#6074)
Browse files Browse the repository at this point in the history
* fix: display tooltips over notifications

* set manual mode via attribute
  • Loading branch information
sissbruecker authored Jun 29, 2023
1 parent a0b56f4 commit 171b663
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@vaadin/menu-bar": "24.2.0-alpha1",
"@vaadin/message-input": "24.2.0-alpha1",
"@vaadin/multi-select-combo-box": "24.2.0-alpha1",
"@vaadin/notification": "24.2.0-alpha1",
"@vaadin/number-field": "24.2.0-alpha1",
"@vaadin/overlay": "24.2.0-alpha1",
"@vaadin/password-field": "24.2.0-alpha1",
Expand Down
31 changes: 31 additions & 0 deletions integration/tests/notification-tooltip.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { expect } from '@esm-bundle/chai';
import { fixtureSync, nextRender } from '@vaadin/testing-helpers';
import '@vaadin/notification';
import '@vaadin/tooltip';

describe('notification and tooltip', () => {
beforeEach(async () => {
const wrapper = fixtureSync(`
<div>
<vaadin-notification></vaadin-notification>
<div id="target"></div>
<vaadin-tooltip for="target" text="Tooltip" manual></vaadin-tooltip>
</div>
`);
const notification = wrapper.querySelector('vaadin-notification');
const tooltip = wrapper.querySelector('vaadin-tooltip');
notification.opened = true;
tooltip.opened = true;
await nextRender();
});

it('should show tooltips above notifications', () => {
const notificationContainer = document.querySelector('vaadin-notification-container');
const tooltipOverlay = document.querySelector('vaadin-tooltip-overlay');

const notificationZIndex = parseInt(getComputedStyle(notificationContainer).zIndex);
const tooltipZIndex = parseInt(getComputedStyle(tooltipOverlay).zIndex);

expect(tooltipZIndex).to.be.above(notificationZIndex);
});
});
4 changes: 4 additions & 0 deletions packages/tooltip/src/vaadin-tooltip-overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themab
registerStyles(
'vaadin-tooltip-overlay',
css`
:host {
z-index: 1100;
}
[part='overlay'] {
max-width: 40ch;
}
Expand Down

0 comments on commit 171b663

Please sign in to comment.