Skip to content

Commit

Permalink
fix(core/select): updated style and multimode functionality (#516)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Leroux <[email protected]>
  • Loading branch information
goncalosard and danielleroux authored May 23, 2023
1 parent 1c2e9a5 commit 8db6883
Show file tree
Hide file tree
Showing 26 changed files with 45 additions and 40 deletions.
23 changes: 19 additions & 4 deletions packages/core/src/components/select/select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
display: inline-block;
position: relative;
height: auto;
width: 100%;
border-radius: var(--theme-input--border-radius);

.select {
position: relative;
Expand All @@ -28,6 +28,7 @@
var(--theme-input--border-color);
border-radius: var(--theme-input--border-radius);
padding: 0 0 0 $small-space;
box-shadow: var(--theme-inset-shadow-1) !important;

@include hover {
background-color: var(--theme-input--background--hover);
Expand All @@ -42,6 +43,10 @@
}
}

.select.readonly {
box-shadow: none !important;
}

.hidden {
display: none !important;
}
Expand Down Expand Up @@ -102,20 +107,30 @@
display: flex;
align-items: center;
justify-content: center;
width: $x-large-space;
min-width: $x-large-space;
height: 100%;
width: 2rem;
min-width: 2rem;
height: 2rem;

@include hover {
color: var(--theme-color-dynamic--hover);
}

@include active {
color: var(--theme-color-dynamic--hover);
}
}

.editable {
.chevron-down-container {
@include hover {
color: var(--theme-color-std-text);
background-color: var(
--theme-btn-invisible-secondary--background--hover
);
}

@include active {
color: var(--theme-color-std-text);
background-color: var(
--theme-btn-invisible-secondary--background--active
);
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/components/select/select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ export class Select {
<ix-dropdown
ref={(ref) => (this.dropdownRef = ref)}
show={this.dropdownShow}
closeBehavior={this.isMultipleMode ? 'outside' : 'both'}
class={{
'd-none': this.disabled || this.readonly,
}}
Expand Down
45 changes: 21 additions & 24 deletions packages/core/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,26 @@

<!DOCTYPE html>
<html dir="ltr" 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>

<script type="module" src="/build/siemens-ix.esm.js"></script>
<script nomodule src="/build/siemens-ix.js"></script>
<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>

<link rel="stylesheet" href="/build/siemens-ix.css" />
<link
rel="stylesheet"
href="/build/ix-brand-theme/dist/ix-brand-theme/ix-brand-theme.css"
/>
<link rel="stylesheet" href="/build/ix-icons/css/ix-icons.css" />
<script type="module">
import { defineCustomElements } from '/build/ix-brand-theme/loader/index.es2017.js';
defineCustomElements();
</script>
</head>
<body style="margin: 0px; height: 100vh">
<my-component />
</body>
</html>
<script type="module" src="/build/siemens-ix.esm.js"></script>
<script nomodule src="/build/siemens-ix.js"></script>

<link rel="stylesheet" href="/build/siemens-ix.css" />
<link rel="stylesheet" href="/build/ix-brand-theme/dist/ix-brand-theme/ix-brand-theme.css" />
<link rel="stylesheet" href="/build/ix-icons/css/ix-icons.css" />
<script type="module">
import { defineCustomElements } from '/build/ix-brand-theme/loader/index.es2017.js';
defineCustomElements();
</script>
</head>

<body style="margin: 0px; height: 100vh">
<my-component />
</body>

</html>
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.
16 changes: 4 additions & 12 deletions packages/core/src/tests/select/select.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,26 @@ regressionTest.describe('select', () => {
await page.goto('select/basic');
await page.locator('.chevron-down-container').click();
await page.waitForSelector('.dropdown-menu.show');
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot({
maxDiffPixelRatio: 0.05,
});
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot();
});

regressionTest('editable', async ({ page }) => {
await page.goto('select/editable');
await page.locator('.chevron-down-container').click();
await page.waitForSelector('.dropdown-menu.show');
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot({
maxDiffPixelRatio: 0.05,
});
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot();
});

regressionTest('mode-multiple', async ({ page }) => {
await page.goto('select/mode-multiple');
await page.locator('.chevron-down-container').click();
await page.waitForSelector('.dropdown-menu.show');
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot({
maxDiffPixelRatio: 0.05,
});
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot();
});

regressionTest('mode-multiple-overflow', async ({ page }) => {
await page.goto('select/mode-multiple-overflow');
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot({
maxDiffPixelRatio: 0.05,
});
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot();
});

regressionTest('mode-multiple-overflow scroll down', async ({ page }) => {
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 8db6883

Please sign in to comment.