Skip to content

docs: clarify closeOnSelect applies to single selects - #6456

Open
sridharkalaibala wants to merge 1 commit into
select2:developfrom
sridharkalaibala:docs/close-on-select-scope
Open

sridharkalaibala wants to merge 1 commit into
select2:developfrom
sridharkalaibala:docs/close-on-select-scope

Conversation

@sridharkalaibala

Copy link
Copy Markdown

This pull request includes a

  • Bug fix (documentation)
  • New feature
  • Translation

The documentation currently says closeOnSelect only applies to multi-select controls. Setting it to false also keeps a single-select dropdown open after selecting a result. Clarify that the option applies to both types.

Fixes #6455.

Validation:

  • python -m mkdocs build --strict passed using the documentation dependencies from pyproject.toml in an isolated Python 3.14 environment. The generated dropdown page contains the corrected sentence. CI-only Git metadata plugins were disabled by the repository's default configuration.
  • Checked defaults.js: the CloseOnSelect decorator is applied outside the single/multiple branch.
  • Exercised the checked-in Select2 4.1.0 bundle with jQuery 3.5.1 in jsdom: selecting Beta in single and multiple controls leaves the dropdown open with closeOnSelect: false and closes it with true (four passing cases). This was a local behavior check, not a real-browser or full QUnit run.
  • git diff --check passed. Only documentation changed.

AI assistance: OpenAI Codex helped investigate, validate, and prepare this change.

@lbesecker195 lbesecker195 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified in defaults.js: the CloseOnSelect decorator is applied whenever options.closeOnSelect is set, with no check on multiple, so the old "multi-select only" note was wrong. LGTM.

@sridharkalaibala

Copy link
Copy Markdown
Author

Thanks for checking the decorator path, @lbesecker195. That confirms why the note needed correcting; the PR keeps the change limited to the documented closeOnSelect behavior.

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.

Documentation bug: closeOnSelect applicable to singe-select controls too

2 participants