This Pull Request has been created because when we replaced select 2 with slim select, a small functionality went missing: in the nested_select, using the collection option in a level that has a parent should only include elements that belong to the selected parent when searching
Detail
This Pull Request restores that functionality, and adds a test for it. It does so by adding to every option the id of it's parent in an attribute with the same name as the parent, and then in the js it checks for options that match the parentId of the select.
Before submitting the PR make sure the following are checked:
[x] This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
[x] Commit message has a concise description of what changed and why.
[x] Tests are added or updated if you fix a bug or add a feature.
[x] Documentation has been added or updated if you add a feature or modify an existing one.
[x] CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature (under the "Unreleased" heading if this is not a version change).
[x] My changes don't introduce any linter rule violations.
Motivation / Background
This Pull Request has been created because when we replaced select 2 with slim select, a small functionality went missing: in the
nested_select
, using thecollection
option in a level that has a parent should only include elements that belong to the selected parent when searchingDetail
This Pull Request restores that functionality, and adds a test for it. It does so by adding to every option the
id
of it's parent in an attribute with the same name as the parent, and then in thejs
it checks for options that match theparentId
of the select.Additional information
Video of the fix working
https://user-images.githubusercontent.com/12057523/234010680-40b3d235-2d9c-42d1-b0d8-42b033f6bf46.mov
Checklist
Before submitting the PR make sure the following are checked: