Skip to content

fix(select): reject selection while disabled - #31688

Open
Xapollon430 wants to merge 1 commit into
ionic-team:mainfrom
Xapollon430:codex/select-disabled-after-open
Open

Xapollon430 wants to merge 1 commit into
ionic-team:mainfrom
Xapollon430:codex/select-disabled-after-open

Conversation

@Xapollon430

@Xapollon430 Xapollon430 commented Nov 3, 2026 •

Copy link
Copy Markdown

Fixes #31687.

Problem

I was playing around with the ion-select component and noticed a bug where:

  1. Open an enabled ion-select.
  2. Set disabled to true while the menu is open.
  3. Click an option. The selection changes and ionChange still fires.

Here is a reproduction video of the issue:

Recorded against @ionic/core 9.0.10. Runnable reproduction includes the required styles and setup.

ionic-disabled-repro.mp4

A property update can send disabled=true after the menu is already open. In an application, that could happen when an asynchronous request completes or a timer fires while someone is choosing an option. The case here is the parent control becoming disabled; the options haven't been individually marked disabled.

My first thought was to close the popup, since that is what I observed with a native HTML select in Chromium. The HTML option-picking algorithm also stops without selecting an option when its select is disabled.

Closing on disable is a reasonable choice too. I'm happy to adjust the PR to follow the library's preferred behavior. The behavior I'm trying to guarantee is simply that a control stops accepting user selections once it becomes disabled.

The change rejects the selection in the shared value-commit path. Alert, popover, and action-sheet options all use that path, so an overlay that was opened before disabling cannot commit a new value. This PR leaves their dismissal behavior alone.

I started investigating this interaction while using Hegel to vary component props and Bombadil to exercise UI actions in Anta. I then reproduced this library's behavior separately; the video above is from that reproduction.

Validation

23 Select spec tests pass, including the new regression; the production build and scoped ESLint pass. All three overlay interfaces were reproduced in Chromium. The new regression fails without the fix.

AI-assisted implementation and testing.

No breaking API change.

Reject user selection after the parent becomes disabled while its menu is open.

Signed-off-by: Vehbi Karaagac <Xapollon430@gmail.com>
@Xapollon430
Xapollon430 requested a review from a team as a code owner November 3, 2026 05:32
@vercel

vercel Bot commented Nov 3, 2026

Copy link
Copy Markdown

@Xapollon430 is attempting to deploy a commit to the Ionic Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ionic-framework Ready Ready Preview Nov 18, 2026 6:33pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — 3b2551d0 Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: ion-select accepts selection after becoming disabled while open

1 participant