diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 7a8d6527b5..786f1e721c 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -21,6 +21,7 @@ body: - label: v4.x - label: v5.x - label: v6.x + - label: v7.x - label: Nightly - type: textarea attributes: diff --git a/.gitignore b/.gitignore index 74e13e50fa..477cce2a4d 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ log.txt *.sublime-project *.sublime-workspace +*.tgz .idea/ .vscode/ diff --git a/angular/scripts/sync.sh b/angular/scripts/sync.sh index ea2dee5fab..98935ceb08 100755 --- a/angular/scripts/sync.sh +++ b/angular/scripts/sync.sh @@ -2,8 +2,11 @@ set -e -# Copy core dist -rm -rf node_modules/@ionic/core/dist node_modules/@ionic/core/components -cp -a ../core/dist node_modules/@ionic/core/dist -cp -a ../core/components node_modules/@ionic/core/components -cp -a ../core/package.json node_modules/@ionic/core/package.json +# Pack @ionic/core +npm pack ../core + +# Pack @ionic/angular +npm pack ./ + +# Install Dependencies +npm install *.tgz --no-save diff --git a/angular/test/base/scripts/sync.sh b/angular/test/base/scripts/sync.sh index ce1d13e180..ab61731a48 100644 --- a/angular/test/base/scripts/sync.sh +++ b/angular/test/base/scripts/sync.sh @@ -2,19 +2,14 @@ set -e -# Copy angular dist -rm -rf node_modules/@ionic/angular -cp -a ../../../dist node_modules/@ionic/angular +# Pack @ionic/core +npm pack ../../../../core -# Copy angular server -rm -rf node_modules/@ionic/angular-server -cp -a ../../../../packages/angular-server/dist node_modules/@ionic/angular-server +# Pack @ionic/angular +npm pack ../../../dist -# # Copy core dist -rm -rf node_modules/@ionic/core -mkdir node_modules/@ionic/core -cp -a ../../../../core/css node_modules/@ionic/core/css -cp -a ../../../../core/dist node_modules/@ionic/core/dist -cp -a ../../../../core/hydrate node_modules/@ionic/core/hydrate -cp -a ../../../../core/loader node_modules/@ionic/core/loader -cp -a ../../../../core/package.json node_modules/@ionic/core/package.json +# Pack @ionic/angular-server +npm pack ../../../../packages/angular-server/dist + +# Install Dependencies +npm install *.tgz --no-save diff --git a/core/src/components/select/select.tsx b/core/src/components/select/select.tsx index e723abbedd..954d2ca7ea 100644 --- a/core/src/components/select/select.tsx +++ b/core/src/components/select/select.tsx @@ -1,5 +1,5 @@ import type { ComponentInterface, EventEmitter } from '@stencil/core'; -import { Component, Element, Event, Host, Method, Prop, State, Watch, h } from '@stencil/core'; +import { Component, Element, Event, Host, Method, Prop, State, Watch, h, forceUpdate } from '@stencil/core'; import { createLegacyFormController } from '@utils/forms'; import type { LegacyFormController } from '@utils/forms'; import { printIonWarning } from '@utils/logging'; @@ -248,6 +248,14 @@ export class Select implements ComponentInterface { this.mutationO = watchForOptions(this.el, 'ion-select-option', async () => { this.updateOverlayOptions(); + + /** + * We need to re-render the component + * because one of the new ion-select-option + * elements may match the value. In this case, + * the rendered selected text should be updated. + */ + forceUpdate(this); }); } diff --git a/core/src/components/select/test/async/index.html b/core/src/components/select/test/async/index.html index 873dcf3cf1..80268e85e8 100644 --- a/core/src/components/select/test/async/index.html +++ b/core/src/components/select/test/async/index.html @@ -43,11 +43,15 @@ > + + + + diff --git a/core/src/components/select/test/async/select.e2e.ts b/core/src/components/select/test/async/select.e2e.ts index 83004222c4..f35ee77508 100644 --- a/core/src/components/select/test/async/select.e2e.ts +++ b/core/src/components/select/test/async/select.e2e.ts @@ -1,18 +1,24 @@ import { expect } from '@playwright/test'; import { test } from '@utils/test/playwright'; -// TODO: This test is extremely flaky -test.skip('select: async', () => { - test('should correctly set the value after a delay', async ({ page, skip }) => { +test.describe('select: async', () => { + test.beforeEach(async ({ page, skip }) => { skip.rtl('This is checking internal logic. RTL tests are not needed'); + skip.mode('md'); await page.goto(`/src/components/select/test/async`); - const selectValueSet = await page.spyOnEvent('selectValueSet'); - - const select = await page.locator('#default'); - - await selectValueSet.next(); + }); + test('should correctly set the value after a delay', async ({ page }) => { + const select = page.locator('#default'); + await page.click('#set-contents'); await expect(select).toHaveJSProperty('value', 'bird'); }); + + test('should re-render when options update but value is already set', async ({ page }) => { + const select = page.locator('#with-value'); + await page.click('#set-contents'); + + await expect(select.locator('.select-text')).toHaveText('bird'); + }); }); diff --git a/core/src/utils/test/overlays/overlays.e2e.ts b/core/src/utils/test/overlays/overlays.e2e.ts index f2a73b037a..9607f22cc4 100644 --- a/core/src/utils/test/overlays/overlays.e2e.ts +++ b/core/src/utils/test/overlays/overlays.e2e.ts @@ -108,8 +108,8 @@ test.describe('overlays: focus', () => { test.beforeEach(({ skip }) => { skip.rtl(); }); - // TODO FW-3080 - test.skip('should not select a hidden focusable element', async ({ page, browserName }) => { + + test('should not select a hidden focusable element', async ({ page, browserName }) => { await page.setContent(`