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

Display tooltip below input field #1540

Open
wants to merge 3 commits into
base: feat/select-validation
Choose a base branch
from
Open
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
6 changes: 5 additions & 1 deletion packages/core/src/components/field-wrapper/field-wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ export class FieldWrapper implements FieldWrapperInterface {
</div>

{this.showTextAsTooltip === true && (
<ix-tooltip for={this.slotRef.waitForCurrent()} showDelay={500}>
<ix-tooltip
for={this.slotRef.waitForCurrent()}
showDelay={500}
placement="bottom"
>
{renderHelperText(textOptions)}
</ix-tooltip>
)}
Expand Down
9 changes: 9 additions & 0 deletions packages/core/src/tests/input/input.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,13 @@ regressionTest.describe('input', () => {
await page.goto('input/with-slots');
await expect(page).toHaveScreenshot();
});

regressionTest('tooltip below input', async ({ page }) => {
await page.goto('input/tooltip');

await page.locator('ix-input').hover();

await expect(page.locator('ix-tooltip')).toBeVisible();
await expect(page).toHaveScreenshot();
});
});
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.
32 changes: 32 additions & 0 deletions packages/core/src/tests/input/tooltip/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!--
SPDX-FileCopyrightText: 2024 Siemens AG

SPDX-License-Identifier: MIT
-->

<!DOCTYPE html>
<html lang="en">
<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>
<style>
ix-input {
margin-top: 5rem;
}
</style>
</head>
<body>
<div>
<ix-input
helper-text="Tooltip text"
show-text-as-tooltip
value="input text"
></ix-input>
</div>
<script src="http://127.0.0.1:8080/scripts/e2e/load-e2e-runtime.js"></script>
</body>
</html>
Loading