Problem/Motivation
Slim Select v3 keeps the same nested settings structure used by Slim Select v2 for the options handled by this module.
The Drupal Slim Select module currently checks the configured Slim Select version in js/slim-select.js and has explicit handling for v1 and v2:
- v1 settings are flattened into the top-level SlimSelect constructor options.
- v2 settings are passed under the nested `settings` object.
When the configured version is `v3.*`, the code does not enter the v2 branch. This means settings such as `placeholderText`, translated search labels, `contentPosition`, `openPosition`, and other supported options may not be passed correctly to the Slim Select constructor.
This blocks projects that are upgrading from Slim Select v2 to v3 while still using drupal/slim_select.
Steps to reproduce
1. Configure the module with a Slim Select v3 version, for example:
version: v3.4.3
2. Use a select element with `#slim_select` options, for example options that set placeholder or positioning values.
3. Load the page and inspect the options passed to `new SlimSelect()`.
Proposed resolution
Treat `v3.*` the same as `v2.*` when building the JavaScript options:
- Use `placeholderText` for v3.
- Pass settings through the nested `settings` object for v3.
The existing v1 behaviour should remain unchanged.
Remaining tasks
- Update `js/slim-select.js`.
- Add or update test coverage if appropriate.
- Confirm v1 and v2 behaviour is unchanged.
Issue fork slim_select-3587857
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
aaron gil martinez commentedLooks good to me +1
Comment #4
aaron gil martinez commented