You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug #2841 [Autocomplete] Ensure default plugins are nicely merged with user-defined plugins (Kocal)
This PR was merged into the 2.x branch.
Discussion
----------
[Autocomplete] Ensure default plugins are nicely merged with user-defined plugins
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Docs? | no <!-- required for new features -->
| Issues | Fix#1128, Fix#2002 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
The issue happens because when merging the default configuration and the configuration defined by the user, plugins defined by the users erase plugins defined in the default configuration:
At the moment, when the user didn't define `tom_select_options.plugins`, everything works fine:
<details>
<summary>Screenshot</summary>
<img width="1800" alt="Capture d’écran 2025-06-13 à 14 22 37" src="https://github.com/user-attachments/assets/744ebb1c-b006-4e73-b90a-af08c32cea3c" />
</details>
But when configuring `tom_select_options.plugins`, some necessary plugins are missing:
<details>
<summary>Screenshot</summary>
<img width="1800" alt="Capture d’écran 2025-06-13 à 14 22 55" src="https://github.com/user-attachments/assets/a9731b2d-5c5c-40f1-a19b-e24524765c05" />
</details>
With this PR, `tom_select_options.plugins` from the default configuration and the configuration defined by the user are nicely merged:
<details>
<summary>Screenshots</summary>
<img width="1800" alt="Capture d’écran 2025-06-13 à 14 23 30" src="https://github.com/user-attachments/assets/a07f47a9-1acb-44a7-90b6-45fcc42c8da4" />
<img width="1800" alt="Capture d’écran 2025-06-13 à 14 23 53" src="https://github.com/user-attachments/assets/1e1d5064-2425-400c-95f3-3ca24f7246ed" />
</details>
## TODO:
- [x] Update JS tests to prevent regressions
Commits
-------
9da1c09 [Autocomplete] Ensure default plugins are nicely merged with user-defined plugins
0 commit comments