Skip to content

Commit

Permalink
Merge branch 'main' into fix/1640-select
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiashader authored Sep 5, 2024
2 parents 0ff0ac3 + f2622bd commit 068bcfe
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .changeset/green-carrots-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@siemens/ix': patch
---

fix(core/tooltip): styles bleeding in
22 changes: 22 additions & 0 deletions .github/workflows/issue-needs-repo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: needs reproduction labeling

on:
issues:
types: [labeled]

jobs:
comment-issue:
if: ${{ github.repository == 'siemens/ix' }}
runs-on: ubuntu-latest
steps:
- name: Needs reproduction comment created
if: "contains(github.event.label.name, 'needs reproduction')"
uses: actions-cool/issues-helper@v3
with:
actions: 'create-comment'
token: ${{ secrets.GITHUB_TOKEN }}
body: |
Thank you for creating this issue! It has been labeled as `needs reproduction`.
To help us assist you better, could you please provide a way for us to access the code (such as a GitHub repository or a StackBlitz link). Without a reliable code reproduction, it might be challenging for us to resolve the issue, and we may have to close it.
Thank you for your understanding!
17 changes: 13 additions & 4 deletions packages/core/src/components/tooltip/tooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
overflow-wrap: break-word;

border-radius: 0.25rem;
background-color: var(--theme-tootlip--background);
padding: 0.375rem 0.75rem 0.375rem 0.875rem;

box-shadow: var(--theme-shadow-4);

.tooltip-title {
display: flex;
Expand All @@ -25,6 +21,19 @@
margin-right: 0.35rem;
}
}

.tooltip-container {
display: block;
position: relative;
width: auto;
height: 100%;
background: var(--theme-tootlip--background);
color: var(--theme-color-std-text);
padding: 0.375rem 0.75rem 0.375rem 0.875rem;

box-shadow: var(--theme-shadow-4);

}
}

:host(.visible) {
Expand Down
22 changes: 12 additions & 10 deletions packages/core/src/components/tooltip/tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -366,17 +366,19 @@ export class Tooltip implements IxOverlayComponent {
}}
role="tooltip"
>
<div class={'tooltip-title'}>
<slot name="title-icon"></slot>
<ix-typography variant="default-title">
{this.titleContent}
<slot name="title-content"></slot>
</ix-typography>
<div class="tooltip-container">
<div class={'tooltip-title'}>
<slot name="title-icon"></slot>
<ix-typography variant="default-title">
{this.titleContent}
<slot name="title-content"></slot>
</ix-typography>
</div>
<div class={'tooltip-content'}>
<slot></slot>
</div>
<div class="arrow"></div>
</div>
<div class={'tooltip-content'}>
<slot></slot>
</div>
<div class="arrow"></div>
</Host>
);
}
Expand Down
25 changes: 25 additions & 0 deletions packages/core/src/tests/tooltip/overlapping-styles/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@


<!--
SPDX-FileCopyrightText: 2024 Siemens AG
SPDX-License-Identifier: MIT
-->

<html>
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0"
/>
<title>Stencil Component Starter</title>
</head>
<body style="padding: 12rem">
<button id="test">Test</button>
<ix-tooltip for="#test" style="background-color: red; width: 25rem; height: 25rem">My tooltip</ix-tooltip>

<script src="http://127.0.0.1:8080/scripts/e2e/load-e2e-runtime.js"></script>
</body>
</html>

11 changes: 11 additions & 0 deletions packages/core/src/tests/tooltip/tooltip.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ regressionTest.describe('tooltip', () => {
});
});

regressionTest('global style not bleeding into tooltip', async ({ page }) => {
await page.goto('tooltip/overlapping-styles');

const tooltipTriggerHandler = await page.waitForSelector('#test');

await tooltipTriggerHandler.hover();
await page.waitForTimeout(500);

expect(await page.screenshot({ fullPage: true })).toMatchSnapshot();
});

test('tooltip position top', async ({ mount, page }) => {
await mount(`
<div style="padding: 10rem">
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 068bcfe

Please sign in to comment.