Skip to content

fix: ignore clicks on disabled autocomplete suggestions - #905

Merged
tkirda merged 2 commits into
tkirda:masterfrom
Xapollon430:codex/disabled-open-autocomplete
Nov 23, 2026
Merged

tkirda merged 2 commits into
tkirda:masterfrom
Xapollon430:codex/disabled-open-autocomplete

Conversation

@Xapollon430

@Xapollon430 Xapollon430 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #904.

An open Autocomplete can still change the input and fire onSelect after disable(). Check the plugin’s disabled state in the delegated suggestion click handler, as the keyboard handlers already do.

Reproduction

Type Al into an input with Alpha and Alpine as local suggestions. Call disable() while the suggestions are open, then click Alpine.

Chrome reproduction video

Test plan

  • npm test (43 passed). The new test fails on the original source and passes with the change. It also verifies that selection works after enable().
  • npm run lint, npm run format:check, npm run typecheck, and npm run build.
  • A normal Chrome click after disable() preserves Al and leaves the callback count at zero.

Reviewer follow-up: removed the changes to all three generated dist/ bundles. The PR now changes only source and tests. All 43 tests pass.

@tkirda-bison

Copy link
Copy Markdown
Contributor

Thanks for the fix and the test. The source change looks good.

One request before merging: could you revert the changes to the dist/ files (jquery.autocomplete.js, jquery.autocomplete.min.js, jquery.autocomplete.esm.js)? Those bundles are regenerated by npm run build as part of the release, so PRs should only touch src/ and test/. Keeping them out avoids conflicts with other open PRs.

Something like this should do it:

git checkout master -- dist/
git commit -m "chore: revert dist changes"
git push

@tkirda
tkirda merged commit 3e9a25b into tkirda:master Nov 23, 2026
3 checks passed
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.

Suggestion click changes the input after disable()

3 participants