Skip to content

fix(smart-select): ignore selections after disabling - #4410

Closed
Xapollon430 wants to merge 1 commit into
framework7io:masterfrom
Xapollon430:codex/ignore-disabled-smart-select-input
Closed

Xapollon430 wants to merge 1 commit into
framework7io:masterfrom
Xapollon430:codex/ignore-disabled-smart-select-input

Conversation

@Xapollon430

Copy link
Copy Markdown

Fixes #4409.

Problem

When the application disables an open Smart Select, its detached sheet inputs still accept selections. The disabled backing select changes from Apple to Orange and emits smartselect:change.

Watch the browser reproduction

Fix

Check whether the backing select or trigger is disabled before processing a popup input change. Dismiss the stale popup without changing the value or emitting a selection event.

Validation

  • Real Chromium clicks against current 9.3.0 source. Backing select disabled, trigger disabled, and both disabled cases fail before the patch and pass afterward; ordinary enabled selection works before and after.
  • The official Framework7 bundle stylesheet is used in the reproduction.
  • Scoped ESLint, Prettier, git diff --check, and npm run build-core:dev pass.

AI-assisted implementation and testing.

@nolimits4web

Copy link
Copy Markdown
Member

Thanks for the report and the PR! Fixed in a slightly different way in 926eede: the disabled check also covers a disabled class on parent elements (e.g. list item) and disabled fieldsets, reverts the clicked input so the popup doesn't show a stale selection, and prevents open() when disabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Smart Select can change value after becoming disabled while open

2 participants