-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(tree): selects all child items when selection-mode is set to ancestors #7518
fix(tree): selects all child items when selection-mode is set to ancestors #7518
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 ⭐
@@ -357,7 +357,7 @@ export class Tree { | |||
item.indeterminate = selected.length > 0 && unselected.length > 0; | |||
} | |||
|
|||
childItemsWithChildren.forEach((el) => { | |||
childItemsWithChildren.reverse().forEach((el) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not an issue at the moment, but this is also modifying the source array. Might not be clear this has happened if you reference the variable afterwards. Calling slice
before reverse
should mitigate this.
🤖 I have created a release *beep* *boop* --- <details><summary>@esri/calcite-components: 1.6.0</summary> ## [1.6.0](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components@1.5.1...@esri/calcite-components@1.6.0) (2023-08-15) ### Features * **action-bar:** Add "actions-end" slot (deprecates "bottom-actions") ([#7435](#7435)) ([1bf14ff](1bf14ff)) ### Bug Fixes * **block:** Defaults the status icon to `scale=s` ([#7503](#7503)) ([e1aee99](e1aee99)) * **button,card,fab,inline-editable:** Provides context to AT users when loading ([#7257](#7257)) ([df33eda](df33eda)) * **chip-group:** Add existence checks ([#7487](#7487)) ([33225a7](33225a7)) * **combobox:** Prevents navigation list with Space key ([#7505](#7505)) ([58e2ff2](58e2ff2)) * **panel:** Fix heading border when only text content is slotted ([#7491](#7491)) ([7704400](7704400)) * **progress:** Completes animation for `dir='rtl'` ([#7511](#7511)) ([c5d6ada](c5d6ada)) * **scrim:** Handle slotted children correctly ([#7477](#7477)) ([c5ce008](c5ce008)) * **scrim:** Render text content inside scrim ([#7509](#7509)) ([643ce5d](643ce5d)) * **slider:** Rerender ticks when prop is modified ([#7439](#7439)) ([20058a9](20058a9)) * **tree:** Selects all child items when selection-mode is set to ancestors ([#7518](#7518)) ([f1eef84](f1eef84)) </details> <details><summary>@esri/calcite-components-react: 1.6.0</summary> ## [1.6.0](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-react@1.5.1...@esri/calcite-components-react@1.6.0) (2023-08-15) ### Bug Fixes * Prevent vitetest/ssr errors due to defining components on the server ([#7521](#7521)) ([046672e](046672e)) ### Dependencies * The following workspace dependencies were updated * dependencies * @esri/calcite-components bumped from ^1.6.0-next.7 to ^1.6.0 </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
🤖 I have created a release *beep* *boop* --- <details><summary>@esri/calcite-components: 1.6.0</summary> ## [1.6.0](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components@1.5.1...@esri/calcite-components@1.6.0) (2023-08-15) ### Features * **action-bar:** Add "actions-end" slot (deprecates "bottom-actions") ([#7435](#7435)) ([1bf14ff](1bf14ff)) ### Bug Fixes * **block:** Defaults the status icon to `scale=s` ([#7503](#7503)) ([e1aee99](e1aee99)) * **button,card,fab,inline-editable:** Provides context to AT users when loading ([#7257](#7257)) ([df33eda](df33eda)) * **chip-group:** Add existence checks ([#7487](#7487)) ([33225a7](33225a7)) * **combobox:** Prevents navigation list with Space key ([#7505](#7505)) ([58e2ff2](58e2ff2)) * **panel:** Fix heading border when only text content is slotted ([#7491](#7491)) ([7704400](7704400)) * **progress:** Completes animation for `dir='rtl'` ([#7511](#7511)) ([c5d6ada](c5d6ada)) * **scrim:** Handle slotted children correctly ([#7477](#7477)) ([c5ce008](c5ce008)) * **scrim:** Render text content inside scrim ([#7509](#7509)) ([643ce5d](643ce5d)) * **slider:** Rerender ticks when prop is modified ([#7439](#7439)) ([20058a9](20058a9)) * **tree:** Selects all child items when selection-mode is set to ancestors ([#7518](#7518)) ([f1eef84](f1eef84)) </details> <details><summary>@esri/calcite-components-react: 1.6.0</summary> ## [1.6.0](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-react@1.5.1...@esri/calcite-components-react@1.6.0) (2023-08-15) ### Bug Fixes * Prevent vitetest/ssr errors due to defining components on the server ([#7521](#7521)) ([046672e](046672e)) ### Dependencies * The following workspace dependencies were updated * dependencies * @esri/calcite-components bumped from ^1.6.0-next.7 to ^1.6.0 </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Related Issue: #7104
Summary
Selects all the child
calcite-tree-item
elements when the root element is selected withselection-mode="ancestors"