diff --git a/.changeset/nine-pugs-pump.md b/.changeset/nine-pugs-pump.md new file mode 100644 index 0000000000..e400eb70ca --- /dev/null +++ b/.changeset/nine-pugs-pump.md @@ -0,0 +1,5 @@ +--- +'@siemens/ix': patch +--- + +fix(core/select): update input value on slot change diff --git a/packages/core/src/components/select/select.scss b/packages/core/src/components/select/select.scss index c4637e6ac7..d3037af592 100644 --- a/packages/core/src/components/select/select.scss +++ b/packages/core/src/components/select/select.scss @@ -126,6 +126,13 @@ } } + ix-icon-button { + height: 1.875rem; + width: 1.875rem; + min-height: 1.875rem; + min-width: 1.875rem; + } + input { @include ellipsis; @include text-default; diff --git a/packages/core/src/components/select/select.tsx b/packages/core/src/components/select/select.tsx index 9dd32470e0..905fb207f7 100644 --- a/packages/core/src/components/select/select.tsx +++ b/packages/core/src/components/select/select.tsx @@ -750,7 +750,11 @@ export class Select { > {this.i18nSelectListHeader} - + { + this.updateSelection(); + }} + >
(this.customItemsContainerRef = ref)} class="d-contents" diff --git a/packages/core/src/components/select/test/select.ct.ts b/packages/core/src/components/select/test/select.ct.ts index d5e01d209c..1e3be1d1ed 100644 --- a/packages/core/src/components/select/test/select.ct.ts +++ b/packages/core/src/components/select/test/select.ct.ts @@ -734,8 +734,8 @@ test.describe('Events', () => { const select = await page.locator('ix-select'); const valueChanged = select.evaluate((elm) => { return new Promise((resolve) => { - elm.addEventListener('valueChange', (e: CustomEvent) => - resolve(e.detail) + elm.addEventListener('valueChange', (e: Event) => + resolve((e as CustomEvent).detail) ); }); }); @@ -753,7 +753,9 @@ test.describe('Events', () => { const select = await page.locator('ix-select'); const itemAdded = select.evaluate((elm) => { return new Promise((resolve) => { - elm.addEventListener('addItem', (e: CustomEvent) => resolve(e.detail)); + elm.addEventListener('addItem', (e: Event) => + resolve((e as CustomEvent).detail) + ); }); }); const input = await page.locator('input'); @@ -795,3 +797,21 @@ test.describe('Events', () => { }); }); }); + +test('async set content and check input value', async ({ mount, page }) => { + await mount(``); + + await page.evaluate(async () => { + const select = document.querySelector('ix-select'); + if (select) { + await new Promise((resolve) => setTimeout(resolve, 1000)); + select.innerHTML = ` + Test + Test + `; + } + }); + + const input = page.locator('input'); + await expect(input).toHaveValue('Item 1'); +}); diff --git a/packages/core/src/tests/pagination/pagination.e2e.ts-snapshots/pagination-advanced-1-chromium---theme-classic-dark-linux.png b/packages/core/src/tests/pagination/pagination.e2e.ts-snapshots/pagination-advanced-1-chromium---theme-classic-dark-linux.png index 8cf3406c9c..d41bf8a7e9 100644 Binary files a/packages/core/src/tests/pagination/pagination.e2e.ts-snapshots/pagination-advanced-1-chromium---theme-classic-dark-linux.png and b/packages/core/src/tests/pagination/pagination.e2e.ts-snapshots/pagination-advanced-1-chromium---theme-classic-dark-linux.png differ diff --git a/packages/core/src/tests/pagination/pagination.e2e.ts-snapshots/pagination-advanced-1-chromium---theme-classic-light-linux.png b/packages/core/src/tests/pagination/pagination.e2e.ts-snapshots/pagination-advanced-1-chromium---theme-classic-light-linux.png index 20aba8c9bf..ddb2b97e44 100644 Binary files a/packages/core/src/tests/pagination/pagination.e2e.ts-snapshots/pagination-advanced-1-chromium---theme-classic-light-linux.png and b/packages/core/src/tests/pagination/pagination.e2e.ts-snapshots/pagination-advanced-1-chromium---theme-classic-light-linux.png differ diff --git a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-allow-clear-1-chromium---theme-classic-dark-linux.png b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-allow-clear-1-chromium---theme-classic-dark-linux.png index daf7f3f714..bc67f9e90f 100644 Binary files a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-allow-clear-1-chromium---theme-classic-dark-linux.png and b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-allow-clear-1-chromium---theme-classic-dark-linux.png differ diff --git a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-allow-clear-1-chromium---theme-classic-light-linux.png b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-allow-clear-1-chromium---theme-classic-light-linux.png index c9111015dc..ae39af71fc 100644 Binary files a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-allow-clear-1-chromium---theme-classic-light-linux.png and b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-allow-clear-1-chromium---theme-classic-light-linux.png differ diff --git a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-autoplacement-1-chromium---theme-classic-dark-linux.png b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-autoplacement-1-chromium---theme-classic-dark-linux.png index 0b5b09c1a9..d847609553 100644 Binary files a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-autoplacement-1-chromium---theme-classic-dark-linux.png and b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-autoplacement-1-chromium---theme-classic-dark-linux.png differ diff --git a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-autoplacement-1-chromium---theme-classic-light-linux.png b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-autoplacement-1-chromium---theme-classic-light-linux.png index f163299dad..6913239ce3 100644 Binary files a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-autoplacement-1-chromium---theme-classic-light-linux.png and b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-autoplacement-1-chromium---theme-classic-light-linux.png differ diff --git a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-basic-1-chromium---theme-classic-dark-linux.png b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-basic-1-chromium---theme-classic-dark-linux.png index 60b7aff528..d9ea5dc4fb 100644 Binary files a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-basic-1-chromium---theme-classic-dark-linux.png and b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-basic-1-chromium---theme-classic-dark-linux.png differ diff --git a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-basic-1-chromium---theme-classic-light-linux.png b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-basic-1-chromium---theme-classic-light-linux.png index 2cff99adcc..ad9a1553d2 100644 Binary files a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-basic-1-chromium---theme-classic-light-linux.png and b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-basic-1-chromium---theme-classic-light-linux.png differ diff --git a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-editable-1-chromium---theme-classic-dark-linux.png b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-editable-1-chromium---theme-classic-dark-linux.png index 60b7aff528..d9ea5dc4fb 100644 Binary files a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-editable-1-chromium---theme-classic-dark-linux.png and b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-editable-1-chromium---theme-classic-dark-linux.png differ diff --git a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-editable-1-chromium---theme-classic-light-linux.png b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-editable-1-chromium---theme-classic-light-linux.png index 2cff99adcc..ad9a1553d2 100644 Binary files a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-editable-1-chromium---theme-classic-light-linux.png and b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-editable-1-chromium---theme-classic-light-linux.png differ diff --git a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-list-header-hide-1-chromium---theme-classic-dark-linux.png b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-list-header-hide-1-chromium---theme-classic-dark-linux.png index 8974a3d427..cb6de439c6 100644 Binary files a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-list-header-hide-1-chromium---theme-classic-dark-linux.png and b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-list-header-hide-1-chromium---theme-classic-dark-linux.png differ diff --git a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-list-header-hide-1-chromium---theme-classic-light-linux.png b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-list-header-hide-1-chromium---theme-classic-light-linux.png index 4e81e4a432..783cdb7f63 100644 Binary files a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-list-header-hide-1-chromium---theme-classic-light-linux.png and b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-list-header-hide-1-chromium---theme-classic-light-linux.png differ diff --git a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-mode-multiple-1-chromium---theme-classic-dark-linux.png b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-mode-multiple-1-chromium---theme-classic-dark-linux.png index cff8b07969..2678ac4153 100644 Binary files a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-mode-multiple-1-chromium---theme-classic-dark-linux.png and b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-mode-multiple-1-chromium---theme-classic-dark-linux.png differ diff --git a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-mode-multiple-1-chromium---theme-classic-light-linux.png b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-mode-multiple-1-chromium---theme-classic-light-linux.png index 15bb80fd8e..db2047a45c 100644 Binary files a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-mode-multiple-1-chromium---theme-classic-light-linux.png and b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-mode-multiple-1-chromium---theme-classic-light-linux.png differ diff --git a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-mode-multiple-overflow-1-chromium---theme-classic-light-linux.png b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-mode-multiple-overflow-1-chromium---theme-classic-light-linux.png index 93dedc9458..f7257ec227 100644 Binary files a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-mode-multiple-overflow-1-chromium---theme-classic-light-linux.png and b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-mode-multiple-overflow-1-chromium---theme-classic-light-linux.png differ diff --git a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-mode-multiple-overflow-scroll-down-1-chromium---theme-classic-dark-linux.png b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-mode-multiple-overflow-scroll-down-1-chromium---theme-classic-dark-linux.png index 2c1a5da016..72fd4a33c4 100644 Binary files a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-mode-multiple-overflow-scroll-down-1-chromium---theme-classic-dark-linux.png and b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-mode-multiple-overflow-scroll-down-1-chromium---theme-classic-dark-linux.png differ diff --git a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-mode-multiple-overflow-scroll-down-1-chromium---theme-classic-light-linux.png b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-mode-multiple-overflow-scroll-down-1-chromium---theme-classic-light-linux.png index 9760ca5c83..e7b0289a63 100644 Binary files a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-mode-multiple-overflow-scroll-down-1-chromium---theme-classic-light-linux.png and b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-mode-multiple-overflow-scroll-down-1-chromium---theme-classic-light-linux.png differ diff --git a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-overflow-1-chromium---theme-classic-dark-linux.png b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-overflow-1-chromium---theme-classic-dark-linux.png index db7161d349..dcd864e487 100644 Binary files a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-overflow-1-chromium---theme-classic-dark-linux.png and b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-overflow-1-chromium---theme-classic-dark-linux.png differ diff --git a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-overflow-1-chromium---theme-classic-light-linux.png b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-overflow-1-chromium---theme-classic-light-linux.png index b45bfd600a..a316497362 100644 Binary files a/packages/core/src/tests/select/select.e2e.ts-snapshots/select-overflow-1-chromium---theme-classic-light-linux.png and b/packages/core/src/tests/select/select.e2e.ts-snapshots/select-overflow-1-chromium---theme-classic-light-linux.png differ