From e77732a750909349c221b026bce60726a0b3f28b Mon Sep 17 00:00:00 2001 From: Vehbi Karaagac <42275242+Xapollon430@users.noreply.github.com> Date: Thu, 12 Nov 2026 13:56:12 -0500 Subject: [PATCH] fix(select): disable interaction with the open list --- CHANGELOG.md | 1 + src/components/select/select.spec.ts | 13 +++++++++++++ src/components/select/select.ts | 2 +- src/components/select/spec.md | 6 ++++-- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index beebd876e..8b9032a2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -329,6 +329,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - The thumb label is in the top layer, so a container that clips its overflow does not cut it. It also shows on keyboard focus, and Escape hides it. - The box of the slider holds the ticks and their labels, so a slider with tick labels is taller. You can remove the space that you added for the labels. A tick label stays on one line. [#2445](https://github.com/IgniteUI/igniteui-webcomponents/pull/2445) - #### Select + - An open list no longer accepts a selection when the Select becomes disabled. [#2601](https://github.com/IgniteUI/igniteui-webcomponents/issues/2601) - In forced colors mode, the list has a border. [#2488](https://github.com/IgniteUI/igniteui-webcomponents/pull/2488) - #### Snackbar, Toast - `container` positioning no longer moves the component to the start of the container in the tab order. [#2447](https://github.com/IgniteUI/igniteui-webcomponents/pull/2447) diff --git a/src/components/select/select.spec.ts b/src/components/select/select.spec.ts index 82aebb6a0..633e08553 100644 --- a/src/components/select/select.spec.ts +++ b/src/components/select/select.spec.ts @@ -30,6 +30,7 @@ import { } from '#internals/testing/form-testbed.spec.js'; import { axeReflectedRelationsOptions, + clickWithMouse, isFocused, withDocumentSheets, } from '#internals/testing/helpers.spec.js'; @@ -587,6 +588,18 @@ describe('Select', () => { await elementUpdated(select); }); + it('rejects a pointer selection after an open select becomes disabled', async () => { + const eventSpy = spy(select, 'emitEvent'); + await openSelect(); + + select.disabled = true; + await elementUpdated(select); + await clickWithMouse(select.items[0]); + + expect(select.value).to.equal('implementation'); + expect(eventSpy).not.calledWith('igcChange'); + }); + it('closes the list when the current selection is clicked again', async () => { await openSelect(); diff --git a/src/components/select/select.ts b/src/components/select/select.ts index c74509f0b..e934146f5 100644 --- a/src/components/select/select.ts +++ b/src/components/select/select.ts @@ -701,7 +701,7 @@ export default class IgcSelectComponent extends FormAssociatedRequiredMixin( protected _renderDropdown() { return html` -
+